GATE | GATE-CS-2017 (Set 2) | Question 42

Consider the following C program:

#include <stdio.h>
int main()
{
    int m = 10;
    int n, n1;
    n = ++m;
    n1 = m++;
    n--;
    --n1;
    n -= n1;
    printf("%d",n);
    return 0;
}

The output of the program is ______.

Note: This questions appeared as Numerical Answer Type.
(A) 0
(B) 1
(C) 2
(D) 3


Answer: (A)

Explanation: https://ide.geeksforgeeks.org/cWm5wo
Gate_set2_42

Quiz of this Question



My Personal Notes arrow_drop_up