Microprocessors - Engineering

Q1:

Let JCOKE = 98 and LPEPSI = 42 Consider the statement

IF (JCOKE - 3 * LPEPSI) 5, 6, 7
5 JCOKE = JCOKE + 5
6 JCOKE = JCOKE + 8
7 JCOKE = JCOKE + 11

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

A 103

B 106

C 109

D none of the above

ANS:A - 103

Since (J COKE - 3 x L PEPSI) is negative, statement 5 is executed and the result is 98 + 5 = 103.