Chapter 3: Problem 20
Give one good reason that you should not use global variables in a program.
Short Answer
Expert verified
Answer: Using global variables in a program is not recommended because they can make the program difficult to understand and maintain. The unrestricted access and modification of global variables throughout the entire code can lead to bugs and errors that are hard to detect and fix. Instead, using local variables and passing data through function parameters and return values can improve code quality, maintainability, and reduce bugs.