a) "x=2" ; statement x+2=1+2=3 is true, so x:= x+1=1+1=2
b) "x=1" ; 1+1"\\neq" 3 and 2+2"\\neq" 3, so x=1
c) "x=2" ; 2+3=5 and 2+4=7, so x:=x+1=2
d) "x=1" ; (x+1=2) is true, (x+2=3) is true, true XOR true is false, so x=1
e) "x=2" ; 1 < 2, so x:= x+1=2
Comments
Leave a comment