3.4.1 - Auto, Extern, Static and Register Storage Classes.
1. Which storage class is the default for local variables in C?
Correct Answer: (C) Auto
2. Which storage class suggests storing variables in the CPU register for faster access?
Correct Answer: (C) Register
3. Which storage class allows a variable to retain its value between function calls?
Correct Answer: (A) Static
4. Which storage class is used to share variables between multiple files?
Correct Answer: (D) Extern
5. What is the initial value of an auto variable if not explicitly initialized?
Correct Answer: (B) Garbage value
6. What is the default initial value of a static variable in C?
Correct Answer: (C) Zero
7. Which storage class cannot be used to declare global variables?
Correct Answer: (B) Auto
8. Where is a variable stored when declared with the register keyword?
Correct Answer: (C) CPU register
9. Which storage class is used when a variable needs to be globally accessible but should retain its value throughout program execution?
Correct Answer: (C) Static
10. In which memory are variables of the auto storage class stored?
Correct Answer: (B) RAM
11. Which of the following storage classes has local scope but global lifetime?
Correct Answer: (B) Static
12. Which storage class is often declared in a header file to allow sharing across multiple source files?
Correct Answer: (C) Extern
13. What is the default value for a variable declared with the extern keyword?
Correct Answer: (B) Zero
14. Which keyword is used to declare a variable that retains its value between multiple function calls in C?
Correct Answer: (B) Static
15. Which storage class is limited in scope to the block where it is declared but does not lose its value once the block is exited?
Correct Answer: (A) Static
16. Which of the following storage classes is commonly used for performance optimization by storing variables in CPU registers?
Correct Answer: (B) Register
17. Which of the following storage classes allows variables to be accessed across different source files in a program?
Correct Answer: (C) Extern
18. Which keyword is optional when declaring a local variable in C?
Correct Answer: (C) Auto
19. Which type of variable cannot have its address taken due to its storage in the CPU register?
Correct Answer: (B) Register
20. Which storage class provides both global visibility and maintains its value throughout the entire program execution?
Correct Answer: (A) Extern