#include<stdio.h>
#include<conio.h>
int main()
{
int num, count = 100, rem, sum;
while(count <= 500)
{
num = count;
sum = 0;
while(num>0)
{
rem = num % 10;
sum = sum + (rem * rem * rem);
num = num / 10;
}
if(count == sum)
{
printf("%d is an Armstrong number\n", count);
}
count++;
}
getch ();
return 0;
}
153 is an Armstrong number
370 is an Armstrong number
371 is an Armstrong number
407 is an Armstrong number
--------------------------------
Process exited after 5.23 seconds with return value 0
Press any key to continue . . .