Open In App

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

Like Article
Like
Save
Share
Report

Consider the following C program:

#include 
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: http://code.geeksforgeeks.org/cWm5wo
Gate_set2_42



Quiz of this Question


Last Updated : 13 Aug, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads