Multiple choice

What will be the output of the following program? #include<stdio.h> #include<conio.h> #include<math.h> int rec(int); int main() {int input(int); int result(int); int x; x=result(1-input(x)+1); printf(result=%d,x); getch(); } int input(int) { int k=5; return k; } int result(int m) { return(pow(m,2)); }

  1. answer = 9

  2. answer = 16

  3. answer = 25

  4. garbage value

  5. none of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The value is returned by input 5. It is subtracted as 1 - 5 + 1 = 2 – 5 = (- 3)2 = 9; Pow(3,2) = 32 = 9 Hence, option (1) is correct.