edited by
12,321 views
40 votes
40 votes

Consider the C program shown below:

#include<stdio.h>
#define print(x) printf("%d", x)

int x;
void Q(int z)
{
        z+=x;
        print(z);
}

void P(int *y)
{
        int x = *y + 2;
        Q(x);
        *y = x - 1;
        print(x);
}
main(void) {
        x = 5;
        P(&x);
        print(x);
}

The output of this program is:

  1. $12 \ 7 \ 6$
  2. $22 \ 12 \ 11$
  3. $14 \ 6 \ 6$
  4. $7 \ 6 \ 6$
edited by

5 Answers

Answer:

Related questions

72 votes
72 votes
4 answers
1