Question 12
Back to Exercise
In C23, what is the type of x in auto x = 2.5f;?
- A int
- B float Correct
- C double
- D auto is only a storage class, so this is an error
Correct Answer: Option B
With an initializer, C23's auto deduces the type: 2.5f is a float. Before C23 the line would have meant "automatic storage, implicit int", which C99 had already removed.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!