Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2015 Set 1
Questions

Q11

NAT1 markProgrammingEasy

The output of the following C program is_____________.

void f1 ( int a, int b) {
    int c;
    c = a; a = b;
    b = c;
}
void f2 ( int * a, int * b) {
    int c;
    c = * a; *a = *b; *b = c;
}
int main () {
    int a = 4, b = 5, c = 6;
    f1 ( a, b);
    f2 (&b, &c);
    printf ("%d", c - a - b);
}
Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.