Concept:
Storage classes in C define:
• Scope of a variable
• Lifetime of a variable
• Visibility of a variable
• Storage location
The four standard storage classes in C are:
\[
\text{auto}
\]
\[
\text{register}
\]
\[
\text{static}
\]
\[
\text{extern}
\]
Step 1: Study the storage classes. auto:
Default storage class for local variables.
register:
Requests storage in CPU registers for faster access.
static:
Preserves variable value throughout program execution.
extern:
Allows access to globally defined variables.
Step 2: Analyze the options.
Option (A) contains all four valid storage classes.
Option (B) contains "global" which is not a storage class keyword.
Option (C) contains invalid entries such as cache and main.
Option (D) contains storage devices rather than storage classes.
Step 3: Select the correct option.
Hence the correct set is
\[
\boxed{\text{Auto, Register, Static, Extern}}
\]
Therefore option (A) is correct.
Was this answer helpful?
0
0
Top TS PGECET Computer Science & Information Technology Questions