Asked by
AL MaMun (4 Golds)
Friday, 31 Jul 2020, 04:08 PM
at (Education
Tutorials)
|
|
|
|
A C Program to find Armstrong number series. #include<stdio.h> int check(int n) { int temp, r, sum=0; temp=n; while(n!=0) { r=n%10; sum=sum+r*r*r; n=n/10; } if(temp==sum) return 1; else return 0; } int main() { int i, upto, is; printf("Find Armstrong Number upto __ ? \n"); scanf("%d", &upto); for(i=1; i<=upto; i++) { is=check(i); if(is==1) printf("%d ", i); } return 0; } |