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 volatile variable in c++?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
What is iostream in c++ used for?
What is expression parser in c++
How many types of classes are there in c++?
What is operators in c++?
What is buffering in c++?
What is class and structure in c++?
What are literals in C++?
Is it possible to write a c++ template to check for a function's existence?
Eplain extern keyword?
What is a c++ map?
Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == ) y-= 7; else y = 8; if the value of x is 4 before the nested IFs are executed, what is the value of y after the nested IFs are executed?
What is virtual methods?
What are protected members in c++?