Open In App

UGC-NET | UGC NET CS 2014 Dec – II | Question 11

What will be the output of the following ‘C’ code?




#include <stdio.h>
 
int main()
{
    int x = 128;
    printf("\n%d", 1 + x++);
     
    return 0;
}

(A)



128

(B)



129

(C)

130

(D)

131


Answer: (B)
Explanation:

In the following C program There is post increment operation: So, printf will print 1 + 128 as output. ++ will increment the x value i.e. x = 129. So, option (B) is correct.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :