Check Whether a Number is Armstrong or Not in C Program
/*Armstrong or Not*/ #include<stdio.h> main() { int n,r,c,sum=0,temp; printf("Enter number:"); scanf("%d",&n); temp=n; while(n>0) { r=n%10; c=r*r*r; sum=sum+c; n=n/10; } n=temp; if(n==sum) printf("ArmStrong Number"); else printf("Not ArmStrong Number"); } Example: 153 …
Check Whether a Number is Armstrong or Not in C Program Read More