Answer Posted / ashish ranjan
#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 ? | 13 Yes | 10 No |
Post New Answer View All Answers
Is C++ case sensitive a) False b) Depends on implementation c) True
What are the characteristics of friend functions?
What are virtual functions in c++?
What is buffering in c++?
What is the difference between #define debug 0 and #undef debug?
What are the rules for naming an identifier?
What is the auto keyword good for in c++?
Why namespace is used in c++?
What are namespaces in c++?
How can you link a c++ program to c functions?
What is enum c++?
Explain the concept of copy constructor?
Explain how a pointer to function can be declared in C++?
what is upcasting in C++?
How const int *ourpointer differs from int const *ourpointer?