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 average salary of a c++ programmer?
Are php strings immutable?
Is multimap sorted c++?
How many types of scopes are there in c++?
What is using namespace std in c++?
What are different types of loops in c++?
What are the characteristics of friend functions?
What is a loop? What are different types of loops in c++?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
Difference between struct and class in terms of access modifier.
What is the use of :: operator in c++?
What are built-in functions? What is the syntax for the definition?
Explain the different access specifiers for the class member in c++.
What is a local reference?
Will this c++ program execute or not?