Answer Posted / saravanan
#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0,n,m;
clrscr();
scanf("%d",&n);
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(m==sum)
{
printf("the given number is amstrong");
else
printf("the given number is not amstrong");
}
getch();
}
| Is This Answer Correct ? | 97 Yes | 70 No |
Post New Answer View All Answers
Does c++ have string data type?
How a new operator differs from the operator new?
what is multi-threading in C++?
What is runtime polymorphism in c++?
What is Destructor in C++?
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass
What are dynamic type checking?
Is there finally in c++?
Can a function take variable length arguments, if yes, how?
Is c++ a difficult language?
What are the implicit member functions of class?
Explain polymorphism?
How to demonstrate the use of a variable?
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
What is function prototyping? What are its advantages?