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 / ankit,rohit

#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0,n,m,i;
clrscr();
scanf("%d",&i);
n=i;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(i==sum)
{
printf("the given number is amstrong");
else
printf("the given number is not amstrong");
}
getch();
}

Is This Answer Correct ?    20 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When is the destructor called?

992


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

1025


What are the vectors in c++?

1001


What is the best c c++ compiler for windows?

1017


What are static and dynamic type checking?

1042


List the features of oops in c++?

1003


What apps are written in c++?

1054


List the issue that the auto_ptr object handles?

986


What is implicit conversion/coercion in c++?

1388


Why are pointers not used in c++?

1106


Is c++ a difficult language?

1070


What is c++ vb?

1049


Explain stack unwinding.

1036


What does extern mean in a function declaration in c++?

1169


Is sorted c++?

1063