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

What is the difference between global int and static int declaration?

1081


What is an accessor in c++?

1088


Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .

1159


When do you call copy constructors?

1167


What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard

1045


Will the following program execute?

1045


Is c++ built on c?

1045


Which is best c++ or java?

1094


Is c++ slower than c?

1055


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.

2597


Do you know about latest advancements in C++ ?

1262


Is c++ map a hash table?

1043


Write a program which employs Recursion

1252


Differentiate between a constructor and a destructor in c++.

1027


What is #include iostream h in c++?

1179