Armstrong Number In Java

Armstrong Number is a number that is the sum of its own digits each raised to the power of the number of digits.

Example:

13+53+33=153 which is same as given number 153., and 3 is the number of digits.

14+64+34+44=1634 which is same as given number 1634., and 4 is the number of digits.

Output:

Is 153 ArmsStrong Number: true
Is 1634 ArmsStrong Number: true
Is 93084 ArmsStrong Number: true
Is 9800817 ArmsStrong Number: true
Is 407 ArmsStrong Number: true
Is 406 ArmsStrong Number: false

One thought on “Armstrong Number In Java

Comments are closed.