1 votes 1 votes #include <stdio.h> double pom(double x,int n){ if(n==1) return x; else return x*pom(x,n-1); --n; } int main() { int a=pom(2,5); printf("%d",a); return 0; } what is the output of following c codeA:2B:32C:16D:NONE Programming in C programming-in-c programming goclasses 1-mark + – shivamSK asked Jun 9 shivamSK 111 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes Answer is Option B.32The function pom calculates the power of a number x to the power n. It uses recursion to achieve this.The base case for the recursion is when n is 1, in which case the function returns x.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.In the main function, the value of pom(2,5) is stored in a. This calculates 2 to the power 5, which is 32.The value of a (32) is then printed to the console using printf. arpat27 answered Jun 10 arpat27 comment Share Follow See all 0 reply Please log in or register to add a comment.