C - Program for Check if a Number is Armstrong Number
#include <stdio.h>
main()
{
int number, sum = 0, temp, remainder;
printf("\n Enter a number :: ");
scanf("%d",&number);
temp = number;
while( temp != 0 )
{
remainder = temp%10;
sum = sum + remainder*remainder*remainder;
temp = temp/10;
}
if ( number == sum )
printf("\n Entered number is an Armstrong number.");
else
printf("\n Entered number is not an Armstrong number.");
return 0;
}