Multiple choice technology programming languages

How many comparisons can a single COBOL if statement make?

  1. 1

  2. 2

  3. There is no limit

  4. COBOL if statements are not used to compare variable values

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A single COBOL IF statement can make only 1 comparison. The IF statement in COBOL evaluates a single condition at a time, though multiple comparisons can be combined using logical operators like AND or OR in nested IF statements or EVALUATE statements. However, a basic IF statement structure (IF condition THEN statement-1 ELSE statement-2) contains exactly one condition check. This design reflects COBOL's emphasis on simple, readable conditional logic.