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. Predict the output:

float x= 3.1496;
cout << setprecision(2) << x;

3.14
3.15
3
3.1

2. What will be the output of the following program?

#include <iostream>
using namespace std;

enum find
{
    a, b, c
};
int main() 
{
    int x = a, y = b, z = c;
    int &p = x, &q = y, &r = z;
    p = ++x;
    q = ++y;
    r = ++c;
    cout<< p << q << r;
    return 0;
}  

The program will print the output 1 2 3.
The program will print the output 2 3 4.
The program will print the output 0 1 2.
It will result in a compile time error.

3. How many variants of tie() function is there?

1
2
3
4

4. Which function concatenates two tuples and returns a new tuple?

tie
tuple_cat
tuple_con
concat

5. Which of the following methods can be used to open a file in file handling?

Using Open ( )
Constructor method
Destructor method
Both A and B

6. 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

7. We can make an instance of an abstract super class

TRUE
FALSE
Can be true and false
Can not say

8. Which other keywords are also used to declare the class other than class?

Struct
Union
Object
Both struct & union

9. _________________ which stores a fixed-size sequential collection of elements of the same type.

loop
array
exception
number

10. Recursion is important because?

reduce the length of our code
make code easy to read
make code easy to write
All of the above

Results