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 do you mean by persistent and non persistent objects?
Please explain the reference variable in c++?
Differentiate between a pointer and a reference with respect to c++.
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
What is difference between malloc()/free() and new/delete?
What is an iterator class in c++?
Specify different types of decision control statements?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?
What is the use of endl in c++ give an example?
What is the use of pointer in c++ with example?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
Where do I find the current c or c++ standard documents?
What is a namespace in c++?
Write a note about the virtual member function?
What is the hardest coding language to learn?