Consider the following C program. # include <stdio.h> void mystery (int *ptra,…

GATE · 2016 · CS · Set 1 · Computer Science & IT

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 is __________.

Attempted by 99 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…