Gate CS-2010 Question Paper With Solutions

Q. 45 What does the following program print ?

#include<stdio.h> 
 void f(int *p, int *q)  {   
 p = q; 
  *p = 2; 
 }  int i = 0, j = 1; 
 int main()  {   
f(&i, &j);    printf("%d %d \n", i, j);    getchar();   
 return 0;

(A) 22

(B) 21

(C) 01

(D) 02

Answer: (D)

Explanation:

Gate CS-2010 Question Paper With Solutions

Learn More:   Gate CS-2016-2 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here