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 function concatenates two tuples and returns a new tuple?

tie
tuple_cat
tuple_con
concat

2. What will be output for the following code?

class Box
{
 int capacity;
   public:
 void print();
 friend void show();
 bool compare();
 friend bool lost();
};

1
2
3
4

3. What will be the output of this program?

#include <iostream>

using namespace std;

class LFC
{
    private:
        int x;
    public:
        void LFC(){x=0; printf("Object created.");}
        void LFC(int a){x=a;}
};
int main()
{
    LFC s;
    return 0;
} 

Compile Time Error
Object Created.
Run Time Error
Cannot be predicted

4. Which is correct syntax for, position n bytes back from end of fileObject ?

FileObject.seekg(ios::end, n);
FileObject.seekg(n, ios:end );
FileObject.seekg(n, ios::end );
FileObject.seekg(ios:end, n);

5. If inner catch handler is not able to handle the exception then__________ .

Compiler will look for outer try handler
Program terminates abnormally
Compiler will check for appropriate catch handler of outer try block
None of the above

6. ios::trunc is used for ?

If the file is opened for output operations and it already existed, no action is taken.
If the file is opened for output operations and it already existed, then a new copy is created.
If the file is opened for output operations and it already existed, its previous content is deleted and replaced by the new one.
None of the above

7. At what point of time a variable comes into existence in memory is determined by its

Data type
Storage class
Scope
All of the above

8. Which of the following access specifier is used as a default in a class definition?

Private
Public
Friend
Protected

9. Which of the following applications of C++ programming?

Application Software Development
Programming Languages Development
Computation Programming
All of the above

10. Which of the following is correct option?

lets(int) called
lets(lfc 2) called
Compiler Error: Ambiguous call to lets()
No error and No output

Results