Answer Posted / tapojit roy
#include<stdio.h>
#include<conio.h>
void main()
{
int n,m,x,sum=0;
clrscr();
printf ("the armstrong no. from 0 to 500 are\n");
for (n=1;n<=500;n++){
m=n;
while (m>0)
{
x=m%10;
sum=sum+(x*x*x);
m=m/10;
}
if (sum==n)
{
printf("%d\n",n);
}
sum=0;
}
getch();
}
Is This Answer Correct ? | 29 Yes | 28 No |
Post New Answer View All Answers
Is java based off c++?
What is time h in c++?
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
What is the difference between a "copy constructor" and an "assignment operator" in C++?
How many keywords are used in c++?
Why c++ does not have finally?
What do you mean by vtable and vptr in c++?
What is a namespace in c++?
How many types of classes are there in c++?
What is an adaptor class in c++?
What are the advantages of inheritance in c++?
How a new operator differs from the operator new?
How to get the current position of the file pointer?
What is the full form of stl in c++?
What is atoi?