void main() { clrscr(); int n,m=0,x,y; cout<<"Enter any three digit numnber:"; cin>>n; y=n; while(n!=0) { x=n%10; m+=pow(x,3); n=n/10; } if(y==m) cout<<"The number is an Armstrong number"; else cout<<"The number is not an Armstrong number"; getch(); }
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.