Types of Storage Class Variables

  1. Automatic

  2. Global

  3. Static

  4. External


Correct Option: A,C,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Automatic - This option is correct. Automatic storage class variables are local variables that are defined inside a function or block. They are created when the function or block is entered and destroyed when the function or block is exited. They have automatic storage duration, meaning they are allocated and deallocated automatically.

Option B) Global - This option is incorrect. Global variables have global scope and are accessible throughout the program. However, they do not fall under the storage class category.

Option C) Static - This option is correct. Static storage class variables are variables that are declared with the "static" keyword. They have static storage duration, meaning they are allocated and preserved throughout the program's execution. They retain their value between function calls and have a lifetime equal to the duration of the program.

Option D) External - This option is correct. External storage class variables are variables that are declared outside of any function or block. They have external storage duration, meaning they are allocated and preserved throughout the program's execution. They can be accessed by multiple source files in a program.

The correct answer is A, C, and D. These options represent the automatic, static, and external storage class variables.

Find more quizzes: