Microprocessors - Engineering

Q1:

Consider the following statement in Basic

15 INPUT X, Y, Z
20 IF Y > X THEN 25
21 IF Z > Y THEN 30
25 PRINT Y
30 PRINT Z, X
35 END


IF X, Y, Z are 150, 200, 250 then the output will be

A 200, 250, 150 respectively

B 150, 200, 250 respectively

C 250, 200, 150 respectively

D 200, 150, 250 respectively

ANS:A - 200, 250, 150 respectively

In this case Y > X , so the control goes to 25. The output is Y , Z , X which are 200 , 250 , 150.