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 the various arithmetic operators in c++?

1091


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

1121


what do you mean by volatile variable?

1002


What are static variables?

1098


What is ifstream c++?

995


What are guid?

1201


Why c++ is called oop?

1071


Can we inherit constructor in c++?

1045


Can you please explain the difference between using macro and inline functions?

1018


What are shallow and deep copies?

1085


Why do we need c++?

997


What are compilers in c++?

1037


Explain shallow copy?

1013


When does the c++ compiler create temporary variables?

1002


Does c++ cost money?

969