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

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

Is This Answer Correct ?    97 Yes 70 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe Trees using C++ with an example.

1141


Differentiate between the message and method in c++?

1054


Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].

1042


State two differences between C and C++.

1154


Difference between pointer to constant and constant pointer to a constant. Give example.

1106


Explain the differences between list x; & list x();.

999


What is rtti in c++?

1125


What is the limitation of cin while taking input for character array?

2053


What are function prototypes?

1230


How long will it take to learn programming?

1044


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

992


What is a forward referencing and when should it be used?

1155


What is singleton class in c++?

1029


What are the various situations where a copy constructor is invoked?

1124


What data encapsulation is in c++?

1127