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 / vinay k bharadwaj

dear frd your ans is wrong.


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

Is This Answer Correct ?    87 Yes 47 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the use of vtable.

1051


What is null pointer and void pointer and what is their use?

1063


Is it possible for a member function to delete the pointer, named this?

1110


Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

1378


How can I learn c++ easily?

1032


Eplain extern keyword?

995


What are structures and unions?

968


Can I learn c++ as my first language?

1079


You run a shell on unix system. How would you tell which shell are you running?

1136


Why do we need constructors in c++?

1081


What is scope in c++ with example?

1070


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

1037


What does new in c++ do?

984


Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.

2554


How are pointers type-cast?

1074