GATE | GATE CS 2008 | Question 85

What is printed by the following C program?

filter_none

edit
close

play_arrow

link
brightness_4
code

$include <stdio.h>
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));
   getchar();
}

chevron_right


(A) 18
(B) 19
(C) 21
(D) 22


Answer: (B)

Explanation: See Question 1 of https://www.geeksforgeeks.org/c-language-set-5/

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.