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 / roshan patel

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,y,d;
cout<<"\nEnter the no : ";
cin>>x;
y=x;
int sum=0;
while(y>0)
{
d=y%10;
y/=10;
sum=sum+d*d*d;
}
if(x==sum)
cout<<"\n "<<x<<" is Armstrong ";
else
cout<<"\n"<<x<<" is not Armstrong";
getch();
}

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is encapsulation in c++?

1207


How to access a variable of the structure?

1014


What is the basic structure of c++ program?

1031


What is c++ used for in games?

1093


Why is it necessary to use a reference in the argument to the copy constructor?

1061


Explain what are single and multiple inheritances in c++?

971


If a function doesn’t return a value, how do you declare the function?

1001


What is a pdb file?

937


What does h mean in maths?

1103


How do you print a string on the printer?

988


What is the precedence when there is a global variable and a local variable in the program with the same name?

1063


Explain operator overloading.

995


What is null pointer and void pointer and what is their use?

1031


program explaining feautures of c++

2389


Why do we need constructors in c++?

1056