Multiple choice technology programming languages

How many comparisons can a single COBOL if statement make?

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

  2. 1

  3. 2

  4. 3

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

A single COBOL IF statement can make exactly one comparison. The syntax is 'IF condition THEN...' where the condition is a single relational expression comparing two values. To evaluate multiple conditions, you must use nested IF statements or combine conditions with AND/OR within a single conditional expression, but the IF statement itself makes one logical comparison. This is a fundamental aspect of COBOL's conditional syntax.