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
What is the best c c++ compiler for windows?
Write a function to find the nth item from the end of a linked list in a single pass.
How is data hiding achieved in c++?
Describe linkages and types of linkages?
What are the characteristics of friend functions?
What is function prototyping?
What is polymorphism in c++? Explain with an example?
Why main function is special in c++?
What is & in c++ function?
Describe Trees using C++ with an example.
What is time_t c++?
Can user-defined object be declared as static data member of another class?
What are manipulators in c++ with example?
What is while loops?
How are the features of c++ different from c?