#include<stdio.h>
#include<conio.h>
main()
{
int a, b, c, d;
int i=1;
printf("Armstrong Number from 1 to 500 are follows:\n\t\t");
for(i=1;i<=500;i++)
{
a=i%10;
b=i%100;
b=(b-a)/10;
c=i/100;
if((a*a*a)+(b*b*b)+(c*c*c)==i)
{printf("%d\n\t\t", i);
}}
getch();
}
No comments:
Post a Comment