Question: what is the difference between global variable and local variable with example?
Answer: Find out the difference between global and local variables. Global variables are declared outside any function, and they can be accessed (used) on any function in the program. Local variables are declared inside a function, and can be used only inside that function.