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

Which programming language is best?

972


What are keywords in c++?

1085


Which bit wise operator is suitable for putting on a particular bit in a number?

1193


What is constant in c++ with example?

1129


What are the different types of polymorphism in c++?

1117


What is the first name of c++?

1041


Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == ) y-= 7; else y = 8; if the value of x is 4 before the nested IFs are executed, what is the value of y after the nested IFs are executed?

2007


What are the operators in c++?

1105


Explain differences between alloc() and free()?

1111


What is a multiset c++?

1130


What are the differences between malloc() and calloc()?

1160


what is pre-processor in C++?

1139


When is the destructor called?

1015


What language is a dll written in?

1015


To which numbering system can the binary number 1101100100111100 be easily converted to?

1049