Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int p=0,n,m,r,c,result=0;
- printf("Input :");
- scanf("%ld",&m);
- m=n;
- while(n!=0){
- n/=10;
- p++;
- }
- m=n;
- while(n!=0){
- r=n%10;
- c= pow(r,p);
- result=result+c;
- n/=10;
- }
- printf("Output : ");
- if(result==m)
- printf("Armstrong \n");
- else printf("Not armstrong \n");
- return 0;
- }
Add Comment
Please, Sign In to add comment