Question: what is the disadvantage of global variables?
Answer: Disadvantages of using Global Variables Too many variables declared as global, then they remain in the memory till program execution is completed. This can cause of Out of Memory issue. Data can be modified by any function. Any statement written in the program can change the value of the global variable.