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

an operation between an integer and real always yeilds a) integer result b) real result c) float result

1110


What is meant by forward referencing and when should it be used?

954


What is static function? Explain with an example

1003


What is difference between c++ 11 and c++ 14?

1017


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

993


What is the use of string in c++?

979


Why do we need constructors in c++?

1064


What are advantages of c++?

960


what Is DCS ? what i will get benefit when i did?

2308


Should I learn c or c++ or c#?

954


How does a copy constructor differs from an overloaded assignment operator?

972


Is c++ the best programming language?

966


Write about the role of c++ in the tradeoff of safety vs. Usability?

1008


What is setbase c++?

1055


Explain the auto storage classes in c++.

1056