//Code
#include<stdio.h>
main()
{
int sum,k,r,i;
for(i=1;i<=500;i++)
{
k=i;
sum=0;
while(k>0)
{
r=k%10;
sum=sum+r*r*r;
k=k/10;
}
if(sum==i)
{
printf("Armstron No = %d\n",i);
}
}
}
#include<stdio.h>
main()
{
int sum,k,r,i;
for(i=1;i<=500;i++)
{
k=i;
sum=0;
while(k>0)
{
r=k%10;
sum=sum+r*r*r;
k=k/10;
}
if(sum==i)
{
printf("Armstron No = %d\n",i);
}
}
}
No comments:
Post a Comment