4) Write a program that takes a 5 digit number and
calculates 2 power
that number and prints it.
Answer Posted / 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 |
Post New Answer View All Answers
What do you mean by a sequential access file?
What is the difference between call by value and call by reference in c?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
Why should I prototype a function?
What is the purpose of the preprocessor directive error?
In c language can we compile a program without main() function?
Can you apply link and association interchangeably?
What do you mean by scope of a variable in c?
Explain high-order bytes.
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What is the difference between new and malloc functions?
What happens if header file is included twice?
What is a stream?
How can you increase the size of a dynamically allocated array?
How many loops are there in c?