Type Conversion & Casting MCQs

11 MCQs  — Data Types MCQs  (Page 1 of 2)

Practice Type Conversion & Casting MCQs with correct answers and explanations. These questions are from the Data Types MCQs section.

In C++11, what happens with int x{3.5};?
Compilation error (narrowing conversion)
x = 3
x = 4
A warning only, and x = 3
Which statement about C++'s auto keyword (C++11) is correct?
The type is deduced at compile time, and the variable stays statically typed
Its type can change when a new value is assigned
It means automatic storage only, with no type deduction
It makes the variable dynamically typed, like Python