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

Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

671


What is c variable?

556


What is #include stdio h?

689


Why are algorithms important in c program?

625


swap 2 numbers without using third variable?

666






Why is c called a structured programming language?

686


I need a sort of an approximate strcmp routine?

664


Why is C language being considered a middle level language?

658


How to create struct variables?

597


What are the general description for loop statement and available loop types in c?

689


What is a macro?

661


can we implement multi-threads in c.

672


What is a char in c?

559


What is the difference between far and near ?

691


any "C" function by default returns an a) int value b) float value c) char value d) a & b

673