Write a program that takes a 5 digit number and calculates
2 power
that number and prints it.
Answer Posted / usha
#include<stdio.h>
void main()
{
unsigned long int s=1;
int n;
scanf("%d%d",&n);
for(int i=0; i<n; i++)
{
s=s*2;
}
printf("result %ld",s);
getch();
}
Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
How to set file pointer to beginning c?
What does main () mean in c?
How can I remove the leading spaces from a string?
How many keywords (reserve words) are in c?
Explain what is wrong with this program statement?
How can I get the current date or time of day in a c program?
How to throw some light on the b tree?
What is the function of this pointer?
Why functions are used in c?
What is size of union in c?
Can math operations be performed on a void pointer?
Suggesting that there can be 62 seconds in a minute?
Why do we use static in c?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?