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

The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

0 Answers  


What is the role of && operator in a program code?

0 Answers  


What is cohesion in c?

0 Answers  


What are loops c?

0 Answers  


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a<b,printb.find the sum digits of that number & then print.if a==b multiply 10 with a & add 20 with b store in c and then print

0 Answers  


What is meant by preprocessor in c?

0 Answers  


4.A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above

6 Answers   Accenture,


Program to find the absolute value of given integer using Conditional Operators

6 Answers   N Tech,


What is the difference between ++a and a++?

0 Answers  


What is the basic structure of c?

0 Answers  


what is difference between array,strutter,union and pointers

3 Answers   CTS, Lovely Professional University, Mannar Company,


What is a Deque?

2 Answers  


Categories