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
Why are pointers used?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What is array in c++ example?
Do inline functions improve performance?
What are the different types of comments allowed in c++?
Does a derived class inherit or doesn't inherit?
Explain function overloading
What is scope in c++ with example?
What is a multimap c++?
What is functions syntax in c++?
Is main a class in c++?
Who invented turbo c++?
what is oops and list its features in c++?
In c++, what is the difference between method overloading and method overriding?
Can we define a constructor as virtual in c++?