Program for Armstrong Number in Java

Here you will get program for armstrong number in java.

A number which is equal to the sum of its digits raised to the power n is called armstrong number. Here n is the total digits in the given number.

Example: 9 is an armstrong number as n = 1 and 9= 9.

153 is an armstrong number as n = 3 and 13 + 53 + 3= 1 + 125 + 27 = 153.

Program for Armstrong Number in Java

 

Output

Enter a number:
8208
Armstrong Number

Comment below if you are facing any difficulty to understand concept of armstrong number in java.

Leave a Reply

Your email address will not be published. Required fields are marked *