Correct option is C
The correct answer is (c) Local
A local variable is a variable that is declared within a function or block and is accessible only within that function or block.
Once the function execution is over, the local variable is destroyed and its memory is released.
It cannot be accessed from outside the function in which it is defined.
Information Booster:
• Local variables have function scope—valid only inside the function where declared.
• They are created when the function is called and destroyed when the function ends.
• If a variable with the same name is declared globally, the local variable will override it within the function.
• In Python, C, Java, etc., local variables are widely used for encapsulation and to avoid conflicts.
• Using local variables helps in memory optimization and cleaner code design.
• Global variables are declared outside all functions and are accessible throughout the program.
• External variables usually refer to variables defined in external files (used in C/C++ with extern keyword).