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 are the various arithmetic operators in c++?
What is the best way to take screenshots of a window with c++ in windows?
What is the use of vtable?
Which one is a preferred language C or C++? Why?
What are different types of loops in c++?
Describe Trees using C++ with an example.
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
Array base access faster or pointer base access is faster?
What's the "software peter principleā?
What is function overloading in C++?
Is c++ slower than c?
Explain unexpected() function?
What is dev c++ used for?
Can member data be public?
Explain the auto storage classes in c++.