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

int a =1 , b=2;
        
a=chg(b) ;
  cout << a << b ;

  If the function chg is coded as
  int chg(int x)
    {
x = 10;

return ();

} 
then  

It results in compile-time error
It results in run time error
It prints 1 1 2
It prints 1 1 1

2. Return type of uncaught_exception() is ___________.

int
bool
char *
double

3. What is this operator called ?:?

conditional
relational
casting operator
unrelational

4. Can we have overloading of the function templates?

Yes
No
May Be
Can't Say

5. What will happen in this code?

int a = 100, b = 200;
int *p = &a, *q = &b
p = q;

b is assigned to a
p now points to b
a is assigned to b
q now points to a

6. getc() returns EOF when

End of files is reached
When getc() fails to read a character
Both A & B
None of the above

7. Which of the following keywords is used to control access to a class member?

Default
Break
Protected
Asm

8. What will be output for the following code?

#include <iostream>
#include <string>
#include <tuple>
using namespace std;
int main()
{
 tuple <int, char, string> tp;
 tp = make_tuple(""Hello"", 4, 'c');
 return 0;
}

Nothing is printed
Compile-time error
Run-time error
Exception occurs

9. Which value is placed in the base class?

Derived values
Default type values
Both A & B
None of the mentioned

10. How many standard exception exist in c++?

9
5
6
7

Results