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
Explain the difference between the local variable and global variable in c?
to find the closest pair
Explain what is the best way to comment out a section of code that contains comments?
How do you sort filenames in a directory?
What is difference between scanf and gets?
What is the difference between printf and scanf in c?
What is return in c programming?
What is the purpose of & in scanf?
Why dont c comments nest?
Why is c called a structured programming language?
largest Of three Number using without if condition?
What are the 4 types of unions?
How can I implement sets or arrays of bits?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is the best style for code layout in c?