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 is private member functions access scope?

Member functions which can used outside the class
Member functions which are accessible in derived class
Member functions which can only be used within the class
Member functions which can't be accessed inside the class

2. Keyword of Floating point is?

double
float
char
floating

3. Which operator is used to insert the data into file?

>>
<<
<
None of the above

4. State whether the following statements about the constructor are True or False. i) constructors should be declared in the private section. ii) constructors are invoked automatically when the objects are created.

True,True
True,False
False,True
False,False

5. Inline functions may not work ______ . i) If function contain static variables. ii) If function contain global and register variables. iii) If function returning value consists looping construct(i.e. for, while). iv) If inline functions are recursive. v) If function contains const value.

Only i,iv & v
Only ii,iii & v
Only i,iii & iv
All of the above

6. When the function has no definition, such function is known as ________ function.

pure virtual function
do-nothing
late function
Both A and B

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

#include <iostream>
using namespace std;
class LFC 
{ 
public: 
    int i; 
    void get(); 
}; 
void LFC::get() 
{ 
    std::cout << "Enter the value of i: "; 
    std::cin >> i; 
} 
LFC t;  
int main() 
{ 
    LFC t;  
    t.get(); 
    std::cout << "value of i in local t: "<<t.i<<'\n'; 
    ::t.get();  
    std::cout << "value of i in global t: "<<::t.i<<'\n'; 
    return 0; 
}

Compiles and runs fine
Compiler Error in Line "::t.get();"
Compiler Error: Cannot have two objects with same class name
Runtime error

8. How many objects reference can refer during its lifetime?

1
2
3
4

9. Which keyword is used to handle the expection?

Try
Throw
Catch
None of the above

10. Which of the following statements is correct? i) Change a reference changes the referent. ii) We can create an array of references.

Only 1 is correct.
Only 2 is correct.
Both 1 and 2 are correct.
Both 1 and 2 are incorrect.

Results