Write a program that takes a 5 digit number and calculates
2 power that number and prints it(should not use big
integers and exponential functions)

Answer Posted / nitin katakdound

int main(int argc, char *argv)
{
long two_power, five_digit_number;

if(scanf("%ld",&five_digit_number)){
two_power = five_digit_number*five_digit_number;}
printf("\n 2 power of that number is %ld",two_power);

return 0;
}

Is This Answer Correct ?    13 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between int main and void main in c?

591


Why we not create function inside function.

1745


What is "Hungarian Notation"?

637


Is it possible to initialize a variable at the time it was declared?

755


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

726






What is the process to create increment and decrement stamen in c?

586


What is string function c?

563


Why is a semicolon (;) put at the end of every program statement?

624


difference between Low, Middle, High Level languages in c ?

1634


What is meant by int main ()?

716


Explain how do you determine a file’s attributes?

592


What is the function of multilevel pointer in c?

669


How to implement a packet in C

2393


Why is structure padding done in c?

641


What is difference between function overloading and operator overloading?

655