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 role of static keyword for a class member variable?
What are the various situations where a copy constructor is invoked?
Is eclipse good for c++?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
Will c++ be replaced?
Explain the virtual inheritance in c++.
What are the benefits of oop in c++?
What is endl c++?
What is the use of structure in c++?
What is c++ best used for?
How do you declare A pointer to a function which receives nothing and returns nothing
Is java the same as c++?
What c++ library is string in?
What are move semantics?
What is a modifier in c++?