Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write the program form Armstrong no in c++?

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


Please Help Members By Posting Answers For Below Questions

What is the best c c++ compiler for windows?

1047


Write a function to find the nth item from the end of a linked list in a single pass.

971


How is data hiding achieved in c++?

1072


Describe linkages and types of linkages?

993


What are the characteristics of friend functions?

1011


What is function prototyping?

1089


What is polymorphism in c++? Explain with an example?

1023


Why main function is special in c++?

1102


What is & in c++ function?

1052


Describe Trees using C++ with an example.

1143


What is time_t c++?

1114


Can user-defined object be declared as static data member of another class?

1016


What are manipulators in c++ with example?

1054


What is while loops?

1042


How are the features of c++ different from c?

1079