79.4k views
0 votes
When possible, you should avoid using _________ variables in a program?

User Kuzdogan
by
6.0k points

1 Answer

5 votes

Answer:

Global variable

Step-by-step explanation:

You should avoid using global variables in a program because global variables can be accessed by any part of the code and every function or any part of the code has the tendency to alter or modify its value. One can't limit the scope or in other words one cant simply force any part of the program not to use them or modify it's values. Testing of large programs also becomes difficult as it is hard to keep track of the functions reading and modifying the values of global variables

User Tevya
by
6.3k points