do my math wrong. | Sololearn: Learn to code for FREE!

+1

do my math wrong.

x = 34 y = ++x z = y++ print Y print Z the answers are? my thought Y = 35 // Z = 35

10/21/2016 12:19:40 PM

INyoman Arisudewa

6 Answers

New Answer

+3

Y is 36, Z is 35.

+1

zen is right if we avoid variable case sensitivity.., can we really avoid case sensitivity??

+1

Good point, chandra, variable names are case-sensitive.

0

y = 35 z= 35

-2

Y is 35 but Z should be 36 .. its beacause .. in the 2nd statement Y becomes 35 n then in third statement first the value of 35 is taken as y and then 1 I incremented I.e. 35+1=36 which the computer stores in its memory. Next, when Print statement takes place then the computer gives 35 as the value of y n 36 as tha value of Z as 36 was stored in the memory.

-2

this is a really chill society