What is printed by the following C program? int f(int x, int *py, int **ppz) {…

GATE · 2008 · CSModified — slightly modified from the official paper; see the solution

What is printed by the following C program?

int f(int x, int *py, int **ppz) { int y, z; **ppz += 1; z = **ppz; *py += 2; y = *py; x += 3; return x+y+z; } void main() { int c, *b, **a; c = 4; b = &c; a = &b; printf("%d", f(c,b,a)); }

  1. A.

    18

  2. B.

    19

  3. C.

    21

  4. D.

    22

Attempted by 183 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…