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

Does c++ have string data type?

1056


How a new operator differs from the operator new?

1058


what is multi-threading in C++?

1003


What is runtime polymorphism in c++?

1086


What is Destructor in C++?

1141


What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

1129


What are dynamic type checking?

982


Is there finally in c++?

1028


Can a function take variable length arguments, if yes, how?

959


Is c++ a difficult language?

1043


What are the implicit member functions of class?

1026


Explain polymorphism?

1030


How to demonstrate the use of a variable?

1048


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

1057


What is function prototyping? What are its advantages?

1031