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


Please Help Members By Posting Answers For Below Questions

How to set file pointer to beginning c?

662


What does main () mean in c?

609


How can I remove the leading spaces from a string?

626


How many keywords (reserve words) are in c?

613


Explain what is wrong with this program statement?

617






How can I get the current date or time of day in a c program?

647


How to throw some light on the b tree?

600


What is the function of this pointer?

666


Why functions are used in c?

580


What is size of union in c?

578


Can math operations be performed on a void pointer?

583


Suggesting that there can be 62 seconds in a minute?

594


Why do we use static in c?

629


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

904


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?

574