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

What are arrays c++?

1117


What is function overloading c++?

1083


How will you call C functions from C ++ and vice-versa?

1148


Explain the uses oof nested class?

1147


When should overload new operator on a global basis or a class basis?

1085


What is fflush c++?

1035


Can we use this pointer inside static member function?

1077


Can circle be called an ellipse?

1082


What is the difference between the indirection operator and the address of oper-ator?

1124


What is a singleton c++?

1013


Can member data be public?

1045


Explain terminate() function?

1064


Explain about Garbage Collector?

1129


Is c or c++ more useful?

1060


What is the use of pointer in c++ with example?

1049