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
Does dev c++ support c++ 11?
What is ifstream c++?
Array base access faster or pointer base access is faster?
Is map thread safe c++?
What is implicit pointer in c++?
What is ios class in c++?
Write a function to find the nth item from the end of a linked list in a single pass.
Explain about templates of C++.
Write a program in c++ to print the numbers from n to n2 except 5 and its multiples
What are the differences between new and malloc?
Should a constructor be public or private?
Explain object slicing in c++?
Keyword mean in declaration?
What is the main use of c++?
What do you mean by friend class & friend function in c++?