Armstrong Number With Example : Java Program Source Code

If the sum of the cubes of the digit is equal to the number then the number is called as Armstrong number .
Armstrong number is also known as narcissistic number or a plus perfect number .

Read Also  :   Fibonacci series Recursion  program in java : Code with example

The name of the term is coined after  Michael F. Armstrong .

for e.g.

take a number 371
we need to check whether it is an armstrong number is or not .
Now
Digits are 3,7,1
cubes of digit are
3*3*3=27
7*7*7=343
1*1*1=1

Sum of cubes of digit =27+343+1
                                 =371  
which is equal to the number itself ,  hence  371 is a armstrong number

About The Author

Subham Mittal has worked in Oracle for 3 years.
Enjoyed this post? Never miss out on future posts by subscribing JavaHungry