a) x=2x=2x=2 ; statement x+2=1+2=3 is true, so x:= x+1=1+1=2
b) x=1x=1x=1 ; 1+1≠\neq= 3 and 2+2≠\neq= 3, so x=1
c) x=2x=2x=2 ; 2+3=5 and 2+4=7, so x:=x+1=2
d) x=1x=1x=1 ; (x+1=2) is true, (x+2=3) is true, true XOR true is false, so x=1
e) x=2x=2x=2 ; 1 < 2, so x:= x+1=2
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments