|
C++ remains one of the most powerful and versatile programming languages, widely used in software development, game programming, and system applications. To excel in C++ programming, it's crucial to test and reinforce your knowledge. One effective way to do this is by tackling C++ MCQs that cover a broad range of topics.
1. What does the 'public' keyword signify in a C++ class? A) Access to the class members is restricted. B) Class members can be accessed by any function or object. C) Only member functions can access the class members. D) The class is invisible to other classes.
2. Which of the following is the correct syntax for a for loop in C++? A) for (int i = 0; i < 10; i++) B) for int i = 0 to 10 C) for (int i = 0, i < 10, i++) D) for (int i = 0; i < 10; i--) 3. How do you declare a constant in C++? A) const int value = 10; B) int const value = 10; C) constant int value = 10; D) value const int = 10;
4. What is the purpose of the 'this' pointer in C++? A) To access the privat
|