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
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work
When does a 'this' pointer get created?
What is the use of c++ programming language in real life?
What are the benefits of pointers?
What does override mean in c++?
What is a responder chain?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
What is a friend function in c++?
Which is better turbo c++ or dev c++?
What is const pointer and const reference?
How is objective c different from c++?
What's the hardest coding language?
What is long in c++?
What are the various compound assignment operators in c++?
Comment on assignment operator in c++.