Electronics and Communication Engineering - Microprocessors - Discussion

Discussion Forum : Microprocessors - Section 2 (Q.No. 22)
22.
Let JCOKE = 3 and LPEPSI = 5. Consider the statement

IF (3 * JCOKE. EQ. LPESPSI)
JCOKE = JCOKE + 2
JCOKE = JCOKE + 5

What will be the final value of JCOKE after the above statement is executed?
8
1
15
10
Answer: Option
Explanation:

The logical IF statement means that IF (3 x J COKE) is equal to (L PEPSI), J COKE = 3 + 2 = 5 otherwise J COKE = 3+5 = 8 Since (3 x J COKE) is more than (L PEPSI), the result is 8.

Discussion:
1 comments Page 1 of 1.

Srivamsi 060 said:   5 years ago
If (expression) true false.

6 equal to 5 false
So, the 2nd statement executed.

Post your comments here:

Your comments will be displayed after verification.