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
Which operations are permitted on pointers?
Write a program to find the Fibonacci series recursively.
What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.
Why is "using namespace std;" considered bad practice?
How we can differentiate between a pre and post increment operators during overloading?
What's the best free c++ profiler for windows?
What are the advantages of using typedef in a program?
What is c++ prototype?
Why Pointers are not used in C++?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
How new/delete differs from malloc()/free?
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?
How delete [] is different from delete?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
What are the various storage classes in C++?