4) 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 / deepshree sinha
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,m
printf("enter any five digit number");
scanf("%d ",&n);
m=pow(2,n);
printf("m=%d",m);
getch();
}
Is This Answer Correct ? | 5 Yes | 4 No |
Answer / nitish kumar choudhary
u have to define int as long unsigned int to increase its
size..
normally int cant give u the answer.
void main()
{
long unsigned int res;
int a;
printf("Enter the 5 digit no.: ");
scanf("%d" ,&a);
printf("result is: %uL", a*a);
getch();
}
Is This Answer Correct ? | 3 Yes | 6 No |
Answer / sathishmani
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
a=12345;
printf("\n The Result is ",a*a);
getch();
}
Is This Answer Correct ? | 6 Yes | 18 No |
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
why Language C is plateform dependent
What is getche() function?
What is calloc in c?
What is the difference between variable declaration and variable definition in c?
Can you apply link and association interchangeably?
write a function to swap an array a[5] elements like a[0] as a[5],a[1] as a[4],....a[5] as a[0].without using more than one loop and use one array not to use temp array?
Tell me the use of bit field in c language?
What is main function in c?
explain what is a newline escape sequence?
can we declare a variable in different scopes with different data types? answer in detail
What is #define?