In COBOL, what is the scope of a local variable declared within a procedure?

  • Accessible globally across all programs
  • Accessible only to other procedures in the same file
  • Available throughout the program
  • Limited to the procedure in which it is declared
A local variable in COBOL is limited to the procedure in which it is declared. It cannot be accessed outside that procedure, providing encapsulation and avoiding naming conflicts.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *