Given the following declarations, what is the result
of each of the expressions?
int w = 2, y = 7, z = 12;
a. w * z
b. w * z +y
c. w * -z
d. w * --z + y++
e. w * z-- + ++y
f. w + z * y
g. w – y + z
h. (w + y) * z
i. y / w
j. y / z
k. w%y
l. y % w
Answer:
a.24
b. 31
c. -24
d. 29
e. 32
f.86
g.7
h.108
i.3
j. 0
k.2
l. 1
Comments
Leave a comment