how do you define global and local variable in Q Basic give an example
Answers
Answer:
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. It is possible to have local variables with the same name in different functions.
Answer:
Local and Global Variables
Local Variables
All the variables we have used thus far have been local variables. A local variable is a variable which is either a variable declared within the function or is an argument passed to a function. As you may have encountered in your programming, if we declare variables in a function then we can only use them within that function. This is a direct result of placing our declaration statements inside functions.