111 views

1 Answer

2 votes
2 votes

Answer is Option B.32


  1. The function pom calculates the power of a number x to the power n. It uses recursion to achieve this.

  2. The base case for the recursion is when n is 1, in which case the function returns x.

  3. For n greater than 1, the function calls itself with n-1 and multiplies the result by x. This effectively calculates the power of x to the power n.

  4. In the main function, the value of pom(2,5) is stored in a. This calculates 2 to the power 5, which is 32.

  5. The value of a (32) is then printed to the console using printf.

Related questions

95
views
1 answers
1 votes
shivamSK asked Jun 9
95 views
what is output of this c codeA: 321B: 123C: error(infinite/segmentation)D:333
1.2k
views
3 answers
2 votes
Laahithyaa VS asked Sep 9, 2023
1,154 views
. What will be the value returned by the following function, when it is called with 11?recur (int num){if ((num / 2)! = 0 ) return (recur (num/2) *10+num%2) ... value, because it goes into an infinite loop (b) 11 (c) 1011 (d) None of these
68
views
0 answers
1 votes
shivamSK asked Jun 19
68 views
#include <stdio.h> void f(int (*x)(int)); int mysh(int); int (*sh)() = mysh; int main() { f(sh); sh++; for(int x=sh;x>=0;x--){ if(x){ printf ... A:10C:10 i will go thereB:10 i will go there number of timesD:10 i will go here number of times