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 / ashish ranjan

#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 ?    13 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is C++ case sensitive a) False b) Depends on implementation c) True

1017


What are the characteristics of friend functions?

968


What are virtual functions in c++?

1121


What is buffering in c++?

1019


What is the difference between #define debug 0 and #undef debug?

1126


What are the rules for naming an identifier?

1014


What is the auto keyword good for in c++?

1118


Why namespace is used in c++?

1011


What are namespaces in c++?

1031


How can you link a c++ program to c functions?

1060


What is enum c++?

1149


Explain the concept of copy constructor?

986


Explain how a pointer to function can be declared in C++?

978


what is upcasting in C++?

1118


How const int *ourpointer differs from int const *ourpointer?

1067