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
daily Routine of father
What is a pointer with example?
How does c++ sort work?
What is a c++ object?
If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?
Write a program to find the reverse Fibonacci series starting from N.
What operators can you overload in c++?
What is c++ 11 and c++ 14?
What is the difference between while and do while loop?
What is a manipulative person?
What is pure virtual function? Or what is abstract class?
We use library functions in the program, in what form they are provided to the program?
How do I write a c++ program?
What do you mean by static variables?
What is difference between c++ 11 and c++ 14?