Vidyalelo
C Programming · Q28

Storage Class

Programming · C Programming · question 28

Q28

What is the default value of an uninitialized 'static' variable in C?

A.
Zero
Answer
B.
Undefined
C.
Garbage value
D.
one

Answer: Option A

Solution

Answer: Option A
Solution:
The default value of an uninitialized 'static' variable in C is zero. Unlike automatic variables (which have an undefined value), static variables are automatically initialized to zero if no explicit initialization is provided.