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 c++ object?
How can you link a c program with a c function?
Which format specifier is used for printing a pointer value?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
How do I start a c++ project?
Can comments be nested?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
What is c++ flowchart?
Can we use clrscr in c++?
Can we define function inside main in c++?
What is the difference between public, private, and protected access?
How we can differentiate between a pre and post increment operators during overloading?
What c++ library is string in?
Is c better than c++?
Which is the best c++ compiler for beginners?