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


Please Help Members By Posting Answers For Below Questions

Explain why c is faster than c++?

566


What are the restrictions of a modulus operator?

628


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

617


What are the advantages and disadvantages of pointers?

570


What is pass by reference in c?

604






Can a file other than a .h file be included with #include?

681


What are variables and it what way is it different from constants?

779


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1425


Explain how can a program be made to print the name of a source file where an error occurs?

682


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

591


What is a macro, and explain how do you use it?

621


What do header files do?

599


what type of questions arrive in interview over c programming?

1551


What does c value mean?

617


What is the basic structure of c?

551