🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.float
  2. B.double
  3. C.int
  4. 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 →