← Quiz: Storage Classes in C: all 15 questions
Quiz: Storage Classes in C · Question 7 of 15
What is the default value of an uninitialised auto (local) int?
What is the default value of an uninitialised auto (local) int?
- A.0
- B.-1
- C.1
- D.Garbage — an unpredictable value
Answer & explanation
Correct answer: Garbage — an unpredictable value
Only static and global variables are set to 0 automatically. Locals must be initialised by you.
Can you get the rest right without peeking?
Take the timed Quiz: Storage Classes in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →