Answer Posted / rahul puri
#include<stdio.h>
#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 ? | 48 Yes | 41 No |
Post New Answer View All Answers
What is a terminating character in c++?
What is this pointer in c++?
Why main function is special in c++?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
What is function overloading c++?
Explain the problem with overriding functions
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
What is the difference between an external iterator and an internal iterator?
What are the restrictions apply to constructors and destructors?
Write about the various sections of the executable image?
What is size_type?
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
How do you clear a buffer in c++?
What is a buffer c++?
What are the extraction and insertion operators in c++?