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 string in c++ programming?
What do the keywords volatile and mean mutable?
What are the various access specifiers in c++?
Can you Mention some Application of C/C++?
What is the difference between while and do while loop? Explain with examples.
How do I use arrays in c++?
What is the difference between *p++ and (*p)++ ?
Is linux written in c or c++?
What are static variables?
what is scupper?
What is the purpose of ios::basefield in the following statement?
What is decltype c++?
What is data abstraction? How is it different from data encapsulation?
Which is the best c++ software?
What is the difference between a type-specific template friend class and a general template friend class?