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
Which programming language is best?
What are keywords in c++?
Which bit wise operator is suitable for putting on a particular bit in a number?
What is constant in c++ with example?
What are the different types of polymorphism in c++?
What is the first name of c++?
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 are the operators in c++?
Explain differences between alloc() and free()?
What is a multiset c++?
What are the differences between malloc() and calloc()?
what is pre-processor in C++?
When is the destructor called?
What language is a dll written in?
To which numbering system can the binary number 1101100100111100 be easily converted to?