Answer Posted / roshan patel
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,y,d;
cout<<"\nEnter the no : ";
cin>>x;
y=x;
int sum=0;
while(y>0)
{
d=y%10;
y/=10;
sum=sum+d*d*d;
}
if(x==sum)
cout<<"\n "<<x<<" is Armstrong ";
else
cout<<"\n"<<x<<" is not Armstrong";
getch();
}
| Is This Answer Correct ? | 17 Yes | 5 No |
Post New Answer View All Answers
What is virtual destructor? What is its use?
explain the reference variable in c++?
What is the insertion operator and what does it do?
Why namespace is used in c++?
How does work in c++?
What are all predefined data types in c++?
What is an incomplete type in c++?
Are c and c++ similar?
Define a pdb file.
How do you initialize a string in c++?
Why was c++ created?
When can I use a forward declaration?
Explain the isa and hasa class relationships. How would you implement each?
What is &x in c++?
What is polymorphism in c++? Explain with an example?