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 / ramesh

#include<iostream.h>
#include<conio.h>
void main()
{
int sum=0,n,m;
clrscr();
cin>>n;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(m==sum)
{
cout<<"the given number is amstrong";
}
else
{
cout<<"the given number is not amstrong";
}
getch();
}

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use the using declaration?

1156


what is c++

2371


Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

1313


What is the difference between the compiler and the preprocessor?

1096


Define linked lists with the help of an example.

1011


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

960


what is the use of void main() in C++ language?

1107


Why was c++ created?

1016


Specify some guidelines that should be followed while overloading operators?

1191


Where can I run c++ program?

1052


Why is main an int?

980


Explain the concept of copy constructor?

1029


What is ios in c++?

1206


How the programmer of a class should decide whether to declare member function or a friend function?

1107


Explain what you mean by a pointer.

1088