Microprocessors - Engineering

Q1:

LET JCOKE = 11 and LPEPSI = 19. Consider the statement

IF (JCOKE - LPEPSI) 5, 5, 7
5 JCOKE = JCOKE + 2
7 JCOKE = JCOKE + 5

The value of JCOKE after the execution of above statement will be

A 13

B 16

C 9

D 14

ANS:A - 13

(J COKE - L PEPSI) is 11 - 19 = - 8 Since (J COKE - L PEPSI) is negative statement 5 is executed and result is 11 + 2 = 13.