Sharpen Your CPP Skills Engaging MCQs for All Levels part four

C++ Skills with Mixed MCQs

1. Which of the following is used to include header files in a C++ program?

2. Which of the following is true about a static variable in C++?

3. Which keyword is used to deallocate memory allocated by 'new' in C++?

4. What will be the output of the following code?
for(int i=1; i<4; i++) { cout << i*2; }

5. What does the 'break' statement do in a C++ loop?

6. What is true about a constructor in C++?

7. What is the purpose of a virtual function in C++?

8. Which of the following is the ternary operator in C++?

9. What is the size of a char in C++?

10. When is a destructor called in C++?

11. What is true about references in C++?

12. What does the 'const' keyword do in C++?

13. What happens when a derived class object is created in C++?

14. What will be the output of the following code?
cout << 'Hello' << 'World';

15. Which keyword is used for dynamic memory allocation in C++?

16. What will be the output of the following code?
int i=0; cout << i++ << i;

17. Which operator is used to cast away constness in C++?

18. What happens when you call a virtual function from a base class pointer pointing to a derived class object?

19. What is true about a pure virtual function in C++?

20. When is the destructor of a class called in C++?

1 2 3 4

Post a Comment

Your comment will be visible after approval.
© TechTestLog. All rights reserved. Premium By Raushan Design
//My script