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 a program that takes a 5 digit number and calculates 2
power that number and prints it

Answers were Sorted based on User's Feedback



Write a program that takes a 5 digit number and calculates 2 power that number and prints it..

Answer / muz

@ ^^^

long int is not sufficient to hold the result of 2^(5 digit
number).
Even if u take long long <variable>, the result will be
displayed as infinity.

Is This Answer Correct ?    4 Yes 0 No

Write a program that takes a 5 digit number and calculates 2 power that number and prints it..

Answer / pradeep

Thank you for giving reply.
But the above program was not correct as Muz said Long int
is not sufficcient to hold result..........

Is This Answer Correct ?    0 Yes 0 No

Write a program that takes a 5 digit number and calculates 2 power that number and prints it..

Answer / cheela deepak

integer range is -32 768 to +32 767 so it doesn't display
value of 2^n(5 digit number)

Is This Answer Correct ?    1 Yes 1 No

Write a program that takes a 5 digit number and calculates 2 power that number and prints it..

Answer / manish soni bca 3rd year jaipu

#include<stdio.h>
#include<conio.h>
void main()
{
int n,p;
long int ans;
printf("Enter the number ans power");
scanf("%d %d",&n,&p);
ans=1;
while(p>0)
{
ans*=n;
p--;
}
printf("%ld",ans);
getch();
}

Is This Answer Correct ?    0 Yes 0 No

Write a program that takes a 5 digit number and calculates 2 power that number and prints it..

Answer / cheela deepak

integer range is not sufficient for given program so result
will not hold

Is This Answer Correct ?    0 Yes 1 No

Write a program that takes a 5 digit number and calculates 2 power that number and prints it..

Answer / manish soni bca 3rd year jaipu

o/p is ;
enter the number 11111
2
123454321

Is This Answer Correct ?    0 Yes 1 No

Write a program that takes a 5 digit number and calculates 2 power that number and prints it..

Answer / subhashini

void main()
{


long int n,x;
clrscr();
printf(" Enter 5 digit number:");
scanf("%d",&n);
x=2^n;
printf("result: %d",x);
getch();
}

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More C Interview Questions

44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?

6 Answers   Amdocs,


how to swap two integers 1 and 32767 without using third variable

11 Answers   Microsoft, TCS,


Why c is a procedural language?

0 Answers  


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

0 Answers  


Explain how can I convert a number to a string?

0 Answers  


What is the modulus operator?

0 Answers  


Who invented bcpl language?

0 Answers  


Explain what is meant by high-order and low-order bytes?

0 Answers  


write a addition of two no. program with out using printf,scanf,puts .

4 Answers  


yogesh patil in dell

3 Answers   DELL,


what is the use of #pragma pack, wer it is used?

2 Answers   Wipro,


Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.

2 Answers  


Categories