Define Armstrong numbers and write program to check given number is Armstrong or not, in C#
belongs to collection: C# Basic Programs | Looping programs
All Answers
total answers (1)
belongs to collection: C# Basic Programs | Looping programs
total answers (1)
Consider the program:
Output
In above program, first of all we are finding total number of digits in given number, and store each digit into an array then using power method of Math class, find power then calculate sum of each result, then comparing sum and number, if it is equal then it is Armstrong otherwise it is not Armstrong.