21. Define Local and Global variables.
Answers
Answer:
You are which class
Explanation:
L Hope answer
Answer:
Variable is a name assign to a storage area that the program can manipulate. A variable type determines the size and layout of the variable's memory.
It also determines the range of values which need to be stored inside that memory and nature of operations that can be applied to that variable.
Explanation:
Local Variable
Local Variable is defined as a type of variable declared within programming block or subroutines. It can only be used inside the subroutine or code block in which it is declared. The local variable exists until the block of the function is under execution. After that, it will be destroyed automatically.
Global Variable
A Global Variable in the program is a variable defined outside the subroutine or function. It has a global scope means it holds its value throughout the lifetime of the program. Hence, it can be accessed throughout the program by any function defined within the program, unless it is shadowed.