C program to print the Armstrong number for three digits of a given

C program to print the Armstrong number for three digits of a given. This program will help you to find the number is Armstrong number or not in C. Here is the program to check whether the number is armstrong number or not an armstrong number  

#include <stdio.h>
int main() 
{
int num, a, rem, result = 0;
printf("Enter the number ");
scanf("%d", &num);
a = num;
while (a != 0) 
{
rem = a % 10;
result += rem * rem * rem;
a /= 10;
}
if (result == num)
printf("%d is an Armstrong number.", num);
else
printf("%d is not an Armstrong number.", num);
return 0;
}
Output
Enter a three-digit integer: 456 
456 is not an Armstrong number