Type conversion and casting — C++ MCQs

10
Score: 0
Attempted: 0/10
1. Which of the following is implicit type conversion in C++?



2. Which of the following is explicit type casting in C++?



3. Which C++ cast is type-safe and checked at compile time?



4. Which cast is used to remove const or volatile qualifier from a variable?



5. What is the type of x after the following operation? double d = 3.7; int x = d;



6. Which of the following casts cannot convert a pointer type safely?



7. What is the result of int(3.9) + int(2.1) in C++?



8. Which C++ cast is mainly used for polymorphic class pointers and references?



9. Which of the following is an example of type promotion?



10. What will the following statement do? float f = static_cast<float>(10/3);



Contents Copyrights Reserved By T4Tutorials