0
f x is 10, what are the values of x and y after the statement below is executed?
If x is 10, what are the values of x and y after the statement below is executed? y = ++x + x++ / 4 * (3 + x++); y = ? x = ? If x is 10, what are the values of x and y after the statement below is executed? y = x++ % 5 - --x * ++x; y = ? x = ? can you show solution i'm struggling with these pleasee :)
3 Antworten
+ 1
X = 10
In first:
Y = ++x + x++ / 4 * (3 + x++)
Y = 11 + 11(now x= 12, post increment) / 4 * (3 + 12(now x = 13, post increment))
Y = 11 + 2 * 15 = 41
X = 13, y = 41
In second:
Y = x++ % 5 - --x * ++x
Y = 10(now x=11, post increment) % 5 - 10 * 11
Y = 0 - 10 * 11 = -110
X = 11, y = -110