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 encapsulation in c++?
How to access a variable of the structure?
What is the basic structure of c++ program?
What is c++ used for in games?
Why is it necessary to use a reference in the argument to the copy constructor?
Explain what are single and multiple inheritances in c++?
If a function doesn’t return a value, how do you declare the function?
What is a pdb file?
What does h mean in maths?
How do you print a string on the printer?
What is the precedence when there is a global variable and a local variable in the program with the same name?
Explain operator overloading.
What is null pointer and void pointer and what is their use?
program explaining feautures of c++
Why do we need constructors in c++?