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 are the various arithmetic operators in c++?

1108


What is the best way to take screenshots of a window with c++ in windows?

1043


What is the use of vtable?

1136


Which one is a preferred language C or C++? Why?

1071


What are different types of loops in c++?

1120


Describe Trees using C++ with an example.

1143


Is it possible to pass an object of the same class in place of object reference to the copy constructor?

1027


Array base access faster or pointer base access is faster?

2288


What's the "software peter principleā€?

1138


What is function overloading in C++?

1405


Is c++ slower than c?

1027


Explain unexpected() function?

1089


What is dev c++ used for?

1025


Can member data be public?

1025


Explain the auto storage classes in c++.

1093