Multiple choice technology mainframe

What will a variable in COBOL contain if it is not initialized?

  1. Will contain zeroes if numeric and spaces if alphabetic or alphanumeric

  2. Will contain spaces for all variables

  3. Will contain an undefined value

  4. None of the above

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

In COBOL, uninitialized variables contain whatever garbage data happens to be in their allocated memory location, making their initial value undefined. They do not automatically default to spaces or zeroes unless explicitly initialized using the VALUE clause or the INITIALIZE statement.