Gate CS-2016-1 Question Paper With Solutions

Q. 25 Consider the following C program.

#include<stdio.h>  void mystery(int *ptra, int *ptrb)   {     int *temp;     temp = ptrb;     ptrb = ptra;     ptra = temp;  }  int main()   {      int a=2016, b=0, c=4, d=42;      mystery(&a, &b);      if (a < c)         mystery(&c, &a);      mystery(&a, &d);      printf("%d\n", a);  }

The output of the program _____________

Note : This question was asked as Numerical Answer Type.

(A) 2016

(B) 0

(C) 4

(D) 8

Answer: (A)

Explanation:

Gate CS-2016-1 Question Paper With Solutions

Learn More:   Gate ME-2018-1 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here