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

Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

1033


When does a 'this' pointer get created?

1049


What is the use of c++ programming language in real life?

1009


What are the benefits of pointers?

997


What does override mean in c++?

1037


What is a responder chain?

1031


How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

1004


What is a friend function in c++?

1531


Which is better turbo c++ or dev c++?

1018


What is const pointer and const reference?

1106


How is objective c different from c++?

1210


What's the hardest coding language?

962


What is long in c++?

1216


What are the various compound assignment operators in c++?

949


Comment on assignment operator in c++.

1087