Program to Find Armstrong Number Between 1 to 500 (in c)
Here is c program to find armstrong number
#include
void main(){ int a,b,c,d,i;printf("The armstrong number between 1 to 500 are : ");i = 1;//loop till 500while(i<=500){c=i;d =i;b = 0;a = 0;//checking each numberwhile(c>0){a = c%10;b +=a*a*a;c = c/10;}if(b==d)printf("\n%d",i);i++;}}
0 comments:
Post a Comment