Answer Posted / ramesh
#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 ? | 4 Yes | 3 No |
Post New Answer View All Answers
Is c++ still in demand?
What is linked list in c++?
Describe new operator?
What are the types of container classes?
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?
Why the usage of pointers in C++ is not recommended ?
How come you find out if a linked-list is a cycle or not?
Why do we use string in c++?
total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.
What is double in c++?
What does it mean to declare a destructor as static?
What is the use of endl in c++?
What is virtual destructor ans explain its use?
Evaulate: 22%5 a) 2 b) 4 c) 0
Difference between a homogeneous and a heterogeneous container