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
Answer / sushant shrivastava
include<math.h>
include<stdio.h>
int main()
{
int i,num;
printf("Enter the value of i");
scanf("%d",&i)
num=POW(i,2);
printf("%d%d",num);
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / anusha
#include<stdio.h>
#include<conio.h>
main()
{
unsigned long integer n;
long integer res=1;
int i=1;
clrscr()
printf("please enter 5 digit no:");
scanf("%ld",&n);
for(i=1,i<=n,i++);
{
res=(res*2);
}
printf("Result is %ld",res);
getch();
}
| Is This Answer Correct ? | 7 Yes | 7 No |
Answer / 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 |
Answer / akshay
#include<stdio.h>
#include<conio.h>
//Develo0ed by Akshay p.Joy
void main()
{
unsigned long int a,s=1;
int i,j,k,l,m,n;
scanf("%d%d",&m);
for(i=0;i<2;++i)
{
s=s*m;
}
printf("result %ld",s);
getch();
}
| Is This Answer Correct ? | 5 Yes | 11 No |
what is the difference between while and do while?
What is the difference between a string and an array?
How does pointer work in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What is bubble sort in c?
why we wont use '&' sing in aceesing the string using scanf
Why should I use standard library functions instead of writing my own?
what is a far pointer
12 Answers ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,
main() { int i = -3,j=2,k=0,m; m= ++i || ++j && ++k; printf("%d%d%d",i,j,k,m); }
Write code for finding depth of tree
Write a program that can show the multiplication table.
What is structure and union in c?