Storage Class in C MCQs Exercise I

Ques 1 Storage Class


A storage class is a ______?

A The variable scope
B It tells about a life of a variable
C Who can access a variable?
D All of these

Ques 2 Storage Class


A variable is defined using auto storage class are called as __________ variable.

A auto
B static
C register
D All of these

Ques 3 Storage Class


A variable is defined using an extern keyword is called as __________ variable.

A Local variable
B Global variable
C Dynamic Variable
D All of these

A variable defined using the extern keyword is called a global variable.
The extern keyword is used to declare a variable that has been defined in another source file. It makes the variable accessible from any part of the program, rather than just within the function where it was defined.
So, the correct answer is b) Global variable.

Ques 4 Storage Class


Static local variable is a _______

A Local variable
B Global variable
C Dynamic Variable
D All of these

Ques 5 Storage Class


A Static global variables are global variables visible only to _________.

A the file in which it is declared
B the file in which it is not declared
C Both (a) to (b)
D All of these