🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Type Casting in C++: all 10 questions

Quiz: Type Casting in C++ · Question 2 of 10

Which cast should you use to convert an int to a double?

Which cast should you use to convert an int to a double?

  1. A.static_cast
  2. B.dynamic_cast
  3. C.const_cast
  4. D.reinterpret_cast
Answer & explanation

Correct answer: static_cast

Number conversions are ordinary compile-time conversions, the job of static_cast.

Can you get the rest right without peeking?

Take the timed Quiz: Type Casting in C++ quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →