Computer Sciences > Gate 2016 Set-1 > Pointer
Consider the following C program
The output of the 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("%dn", a);
}
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("%dn", a);
}
The output of the program _____________
Correct : a
Similar Questions
Consider the C code fragment given below.
typedef struct node
{
int data;
node* next ;
} node;
void join(node* m, node* n)
{
...
Consider the C code fragment given below.
typedef struct node
{
int data;
node* next ;
} node;
void join(node* m, node* n)
{
...
Consider the following C code:
#include<stdio.h>
int * assignval (int *x, int val)
{
*x = val;
return x;
}
int main()...
Total Unique Visitors
Loading......