Dain1234 / Design-and-analysis-algorithm

0 stars 0 forks source link

Armstrong number #2

Open Dain1234 opened 2 years ago

Dain1234 commented 2 years ago

Screenshot (45)

Dain1234 commented 2 years ago

include

int main() { int n,r,sum=0,temp; printf("enter the number="); scanf("%d",&n); temp=n; while(n>0) { r=n%10; sum=sum+(rrr); n=n/10; } if(temp==sum) printf("armstrong number "); else printf("not armstrong number"); return 0; }