Question Detail

COS 102 If staments Objective Question

Question

If you need to check if a variable named balance is greater than or equal to 5000, which relational operator would you use?
Options
A balance = 5000
B balance > 5000
C balance <= 5000
D balance >= 5000
Correct Answer
Correct Answer

Option D is the correct answer.

Detailed Explanation

Page 10, 'Relational Operators', shows that '>=' means 'Greater than or Equal'. This matches the condition 'greater than or equal to 5000'.

Hint

Recall the meaning of each relational operator, particularly those involving 'equal'.

Question Info