Answer Posted / ankit,rohit
#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0,n,m,i;
clrscr();
scanf("%d",&i);
n=i;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(i==sum)
{
printf("the given number is amstrong");
else
printf("the given number is not amstrong");
}
getch();
}
| Is This Answer Correct ? | 20 Yes | 22 No |
Post New Answer View All Answers
What are the data types in c++?
Define Virtual function in C++.
Differences between private, protected and public and give examples.
what is COPY CONSTRUCTOR and what is it used for?
Explain the difference between overloading and overriding?
Are there interfaces in c++?
Why should we use null or zero in a program?
What is the basic concept of c++?
What is scope resolution operator in c++ with example?
Can we use this pointer in a class specific, operator-overloading function for new operator?
Are c and c++ similar?
What is the basic structure of a c++ program?
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
Why do we use setw in c++?
What is meant by const_cast?