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 / rahul puri

#include<stdio.h>
#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 ?    48 Yes 41 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a terminating character in c++?

1325


What is this pointer in c++?

1313


Why main function is special in c++?

1061


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

2583


What is function overloading c++?

1023


Explain the problem with overriding functions

1094


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

1060


What is the difference between an external iterator and an internal iterator?

1052


What are the restrictions apply to constructors and destructors?

1031


Write about the various sections of the executable image?

936


What is size_type?

972


If you want to share several functions or variables in several files maitaining the consistency how would you share it?

931


How do you clear a buffer in c++?

921


What is a buffer c++?

994


What are the extraction and insertion operators in c++?

948