# C program to check Armstrong number | Armstrong Program in C

### What is Armstrong Number?

• A number N is an Armstrong number of order n (n being the number of digits)
• if abed. . . = a^n + b^n + e^n + d^n .+ . . . = N .
• The number 153 is an Armstrong number of order 3 because
• l^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153.
• Likewise, 54748 is an Armstrong number of order 5 because
• 5^5 + 4^5 + 7^5 + 4^5 + 8^5 = 3125 + 1024 + 16807 + 1024 + 32768 = 54748.

1. #include<stdio.h>
2. int main()
3. {
4.     int n;
5.     int r;
6.     int sum=0;
7.     int temp;
8.     printf("Enter a number \n");
9.     scanf("%d",&n);
10.     temp=n;
11.                  while(n>0)
12.                      {
13.                        r=n%10;
14.                        sum=sum+(r*r*r);
15.                        n=n/10;
16.                      }
17.      if(temp == sum)
18.      printf("Number is a armstrong number\n");
19.      else
20.      printf("Number is NOT a armstrong number\n");
21.      return 0;
22. }