Programming Techniques 11 Flashcards
1
Q
Define local variable.
A
A local variable is typically declared inside a subroutine and can only be accessed by that subroutine. It is created when the subroutine is called and is destroyed when the subroutine ends.
2
Q
Define global variable.
A
A global variable is typically declared at the top of a program outside any subroutine and is accessible throughout the program. It is created when the program starts and is destroyed when the program ends.