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 / astitva srivastava

#include<iostream.h>
#include<conio.h>
void main()
{
int n,r,s=0;
cout<<"enter the no.";
cin>>n;
int b=n;
while(n>0)
{
r=n%10;
n=n/10;
s=s+(r*r*r);
}
if(b==s)
{
cout<<"the no. is armstrong"<<"\n";
}
else
{
cout<<"the no. is not a armstrong no.";
}
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is low level language in simple words?

1000


What is the default width for ouputting a long integer using the insertion operator?

1201


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

1040


Explain all the C++ concepts using examples.

1164


When are exception objects created?

1039


How are the features of c++ different from c?

1037


What are separators in c++?

1051


which of the following is not an secondary constant a) array b) real c) union

1776


What is a linked list in c++?

1017


How const int *ourpointer differs from int const *ourpointer?

1084


How long it will take to learn c++?

1020


How do I run a program in notepad ++?

1066


Explain virtual class and friend class.

1015


How do you establish a has-a relationship?

1059


What is conditions when using boolean operators?

1160