Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- main()
- {
- int n,a,sum=0,r;
- scanf("%d",&n);
- while(n>0)
- {
- r=n%10;
- a=r*r*r;
- sum=sum+a;
- n=n/10;
- }
- if(n==sum)
- printf("armstrong number");
- else
- printf("not armstrong number");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment