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
Which software is best for coding?
Please explain the reference variable in c++?
How can you quickly find the number of elements stored in a dynamic array?
Is map thread safe c++?
What is an html tag?
What are c++ stream classes?
Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.
Why is the function main() special?
What is the auto keyword good for in c++?
How to declaring variables in c++?
What are dynamic type checking?
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].
Why cout is used in c++?
What is a constructor in c++ with example?
What does int * mean in c++?