algorithms.tutorialhorizon.com

Check if the given number is Armstrong number or not | Algorithms

Objective: Given a number, write a program to find out whether the number is Armstrong number or not What is Armstrong number: Determine the number of digits in the number. Call that n. Then take every digit in the number and raise it to the n power. Add all those together, and if your answer is the original number then it is an Armstrong number. Example: N = 123 digits = 3 1^3+2^3+3^3=36 123 is not Armstrong number. Output: false N = 153 digits = 3 1^3+5^3+3^3=153