1.

Consider the following statements:-int x = 6, y=8, z, w;y = x++;z = ++x;The value of x,y,z by calculating the above expressions are:-(A) y=8, z=8, x=6(B) y=6, x=8, z=8(C) y=9, z=7, x=8(D) y=7, x=8, z=7

Answer»

Correct option - (B) y=6, x=8, z=8

Explanation:-

y is assigned value of x that is 6, then x in incremented that is value of x=7, z is assigned value of x after incrementing that is z =8 so value of x =8. 



Discussion

No Comment Found

Related InterviewSolutions