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 of the following operator functions cannot be global, i.e., must be a member function.

new
delete
Converstion Operator
All of the above

2. What is true about bitset?

A bitset is an array of bool 
A limitation of bitset is, N must be known at compile time
As bitset stores the same information in compressed manner the operation on bitset are faster than that of array and vector.
All of the above

3. Can main() function be made private?

Yes, always
Yes, if program doesn't contain any classes
No, because main function is user defined
No, never

4. The number of values between braces { } can not be larger than the number of elements that we declare for the array between square brackets [ ].

TRUE
FALSE
Can be true or false
Can not say

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

Private
Public
Friend
Protected

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. What will be the output of this program?

#include <iostream>
using namespace std;
 
template <int i>
void fun()
{
   i = 20;
   cout << i;
}
 
int main()
{
   fun<10>();
   return 0;
}

Compile Error
10
20
15

8. Which of the following correctly declares an array in C++?

array{10};
array array[10];
int array;
int array[10];

9. What will be the output of this program?

#include <iostream>
using namespace std;
  
template<int n> struct funStruct
{
    static const int val = 2*funStruct<n-1>::val;
};
  
template<> struct funStruct<0>
{
    static const int val = 1 ;
};
  
int main()
{
    cout << funStruct<10>::val << endl;
    return 0;
}

Compiler Error
1
2
1024

10. A programming language is said to use static typing when type checking is performed during compile-time as opposed to run-time.

TRUE
FALSE
Can be true or false
Can not say

Results