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 the syntax for a for loop?
What is c++ best used for?
What c++ is used for?
What is array give example?
Define a nested class.
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
Explain differences between new() and delete()?
Explain data encapsulation?
Can non graphic characters be used and processed in C++?
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
What is format for defining a structure?
Is c++ a difficult language?
What are c++ stream classes?
What is the use of pointer in c++ with example?
What is stl containers in c++?