Gate CS-2017-2 Question Paper With Solutions

Q. 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:

Gate CS-2017-2 Question Paper With Solutions

Learn More:   Gate EC-2018 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here