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
Does there exist any other function which can be used to convert an integer or a float to a string?
What is the use of :: operator in c++?
Can I learn c++ as my first language?
Explain the concept of memory leak?
Can we run c program in turbo c++?
What is the v-ptr?
What are the advantages of prototyping?
What do you mean by stack unwinding in c++?
What can I safely assume about the initial values of variables which are not explicitly initialized?
Define private, protected and public access control.
What are the types of array in c++?
Explain deep copy?
What does obj stand for?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
What are the various arithmetic operators in c++?