Answer Posted / sarang deshpande
#include<iostream.h>
#include<conio.h>
void main()
{
int n,n1,sum,rem;
clrscr();
cout<<" \n Enter a num ";
cin>>n;
n1=n;
sum=0;
while(n>0)
{
rem=n%10;
sum=sum+(rem*rem*rem);
n=n/10;
}
if(n1==sum)
{
cout<<"\n The number is armstrong "<<n1;
}
else
{
cout<<"\n The number is not armstrong "<<n1;
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is a multimap c++?
What is a block in c++?
Explain the use of this pointer?
What is the use of map in c++?
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
Is main a class in c++?
Name the implicit member functions of a class.
What is the role of copy constructor in copying of thrown objects?
What is a flag in c++?
What does int * mean in c++?
What is the benefit of learning c++?
How we can differentiate between a pre and post increment operators during overloading?
What operators can you overload in c++?
What is c++ coding?
When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?