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
Why do we use the using declaration?
what is c++
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What is the difference between the compiler and the preprocessor?
Define linked lists with the help of an example.
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
what is the use of void main() in C++ language?
Why was c++ created?
Specify some guidelines that should be followed while overloading operators?
Where can I run c++ program?
Why is main an int?
Explain the concept of copy constructor?
What is ios in c++?
How the programmer of a class should decide whether to declare member function or a friend function?
Explain what you mean by a pointer.