← Quiz: C++ Introduction: all 10 questions
Quiz: C++ Introduction · Question 9 of 10
What type does auto x = 3.5; give x?
What type does auto x = 3.5; give x?
- A.float
- B.double
- C.int
- D.auto is not a real type, so it is an error
Answer & explanation
Correct answer: double
A literal like 3.5 is a double, and auto takes the type of its initialiser.
Can you get the rest right without peeking?
Take the timed Quiz: C++ Introduction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →