Open In App

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

Like Article
Like
Save
Share
Report

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

C




#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


Last Updated : 25 Jun, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads