C++ Programming Quiz


Play this c++ quiz that will help you to excel in C++ certification exams, placements etc. This C++ programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This C++ programming test enables you to assess your knowledge of C++ programming.

Take the Free Practice Test



C++ MCQs

Practice C++ MCQ Questions, which will help you to understand C++ programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

C++ Quiz

Try Free C++ Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

C++ Quiz

1. When struct is used instead of the keyword class means, what will happen in the program?

Access is public by default
Access is private by default
Access is protected by default
None of the mentioned

2. How many bits of memory needed for internal representation of class?

1
2
4
No memory needed

3. ___________ inheritance may lead to duplication of inherited members from a "grandparent" base class.

Multipath
Multiple
Multilevel
Hierarchical

4. What is a count of standard exception?

9
5
6
7

5. Which illustrate predefined exceptions

Memory allocation error
I/O error
Both A and B
None of the above

6. Which of the following are the limitations of virtual functions?

function call takes slightly longer time
virtual functions can make it a little more difficult to figure out where a function is being called from
Both A and B
None of the above

7. What is the output of this program?

         
Note:Includes all required header files

    using namespace std;
    int main() 
    {
        string s = "a long string";
        s.insert(s.size() / 2, " * ");
        cout << s << endl;
        return 0;
    }

long* string
a long st*ring
Depends on compiler
None of the mentione

8. Which of the following is true about the following program

#include <iostream>
using namespace std;

int main()
{
    int p = 45; 
    int &q = p;
    p++;
    cout << p << " " << --q;
    return 0;
}  

The program will print the output 45 45.
The program will print the output 46 40.
The program will print the output 46 46.
It will result in a compile time error. View Answer

9. Which of the things does not require instantiation?

Functions
Non virtual member function
Member class
All of the above

10. Which is the correct statement about pure virtual functions?

They should be defined inside a base class
Pure keyword should be used to declare a pure virtual function
Pure virtual function is implemented in derived classes
Pure virtual function cannot implemented in derived classes

Results