Answer Posted / ashish ranjan
#include<iostream.h>
#include<conio.h>
void main()
{
int sum=0,n,m;
clrscr();
cin>>n;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(m==sum)
{
cout<<"the given number is amstrong";
}
else
{
cout<<"the given number is not amstrong";
}
getch();
}
Is This Answer Correct ? | 13 Yes | 10 No |
Post New Answer View All Answers
What is a character in c++?
Is swift better than c++?
Where is atoi defined?
What is class and structure in c++?
Explain the difference between class and struct in c++?
How do you establish an is-a relationship?
Are c and c++ similar?
How can you tell what shell you are running on unix system?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What is the last index number in an array of 100 characters a) 100 b) 99 c) 101
What are disadvantages of pointers?
Explain the difference between using macro and inline functions?
What are static type checking?
Will a catch statement catch a derived exception if it is looking for the base class?