Answer Posted / ramesh
#include<iostream.h>
#include<conio.h>
void main()
{
int sum=0,n,m;
clrscr();
cin>>n;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(m==sum)
{
cout<<"the given number is amstrong";
}
else
{
cout<<"the given number is not amstrong";
}
getch();
}
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
Difference between pointer to constant and constant pointer to a constant. Give example.
Should the this pointer can be used in the constructor?
What is functions syntax in c++?
What is the use of 'using' declaration in c++?
What does scope resolution operator do?
What is nested class in c++?
What is c++ programming language?
What is Destructor in C++?
What is heap sort in c++?
What is a storage class?
What should main() return in c and c++?
What is the difference between structure and class?
What is DlgProc?
Explain virtual class?
What are disadvantages of pointers?