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. Which symbol is used to create multiple inheritance?

Dot
Comma
Dollar
None of the above

2. Pointer operator * is pointer to a variable.

Yes
No
Can be yes or no
Can not say

3. How can we make a class abstract?

By declaring it abstract using the static keyword
By declaring it abstract using the virtual keyword.
By making at least one member function as pure virtual function
By making all member functions constant

4. fseek() should be preferred over rewind() mainly because

In rewind, there is no way to check if the operations completed successfully
rewind() doesn't work for empty files
rewind() does work for empty file
All of the above

5. What are the things are inherited from the base class?

Constructor and its destructor
Operator=() members
Friends
All of the above

6. Which of the following correctly describes overloading of functions?

Virtual polymorphism
Transient polymorphism
Ad-hoc polymorphism
Pseudo polymorphism

7. What is the output of this program?

        
Note:Includes all required header files 
          
using namespace std;
    int main () 
    {
        ofstream outfile ("find.txt");
        for (int i = 0; i < 70; i++)
        {
            outfile << i;
            outfile.flush();
        }
        cout << "Done";
        outfile.close();
        return 0;
    }       

Done
Error
Runtime error
None of the mentioned

8. Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?

Preprocessor
Linker
Loader
compiler

9. C++ comprises a combination of?

high-level language
low-level language
high-level and low-level language
Can not say

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

Note:Includes all required header files
using namespace std;
   long factorial (long p)
    {
        if (p > 1)
            return (p * factorial (p + 1));
        else
            return (1);
    }
    int main ()
    {
        long q = 3;
        cout << q << "! = " << factorial ( q );
        return 0;
    }

6
24
segmentation fault
compile time error

Results