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
What is the purpose of scanf() and printf() functions?
What is void pointers in c?
What is the scope of static variable in c?
Which is better oop or procedural?
What are linker error?
Describe newline escape sequence with a sample program?
Write a program to swap two numbers without using third variable?
What are the types of type qualifiers in c?
Define circular linked list.
Is c call by value?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Why is structure important for a child?
What is calloc() function?
What are qualifiers in c?
Is there any demerits of using pointer?