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