C++ Online Quiz - TutorialsPoint

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

9/5/2017 C++ Online Quiz - TutorialsPoint

C++ Online Quiz


Advertisements
LAPCARE 6 CELL
Rs. 1,598.00
(details + delivery)


Questions Page Next Quiz

Following quiz provides Multiple Choice Questions (MCQs) related to C++ Framework. You will have to read all the given answers and
click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can
use Next Quiz button to check new set of questions in the quiz.

Q 1 - What is the output of the following program?

#include<iostream>

using namespace std;


class abc {
public:
static int x;
int i;

abc() {
i = ++x;
}
};
int abc::x;

main() {
abc m, n, p;

cout<<m.x<<" "<<m.i<<endl;
}

A-31

B-33

C-11

D-13

Show Answer

Q 2 - The operator used to access member function of a structure using its object.

A-.

B - ->

C-*

D - None of the above.

Show Answer

https://www.tutorialspoint.com/cplusplus/cpp_online_quiz.htm 1/3
9/5/2017 C++ Online Quiz - TutorialsPoint

Q 3 - Pick up the valid declaration for overloading ++ in postfix form where T is the class name.

A - T operator++();

B - T operator++(int);

C - T& operator++();

D - T& operator++(int);

Show Answer

Q 4 - Escape sequence character '\0' occupies __ amount of memory.

A-0

B-1

C-2

D-4

Show Answer

Q 5 - What is the output of the following program?

#include<iostream>

using namespace std;


main() {
int *p = new int;
delete p;
delete p;
cout<<"Done";
}

A - Done

B - Compile error

C - Runtime error

D - None of the above

Show Answer

Q 6 - What is a generic class.

A - Function template

B - Class template

B - Inherited class

B - None of the above.

Show Answer

Q 7 - What is the output of the following program?

#include<iostream>

using namespace std;


main() {
short unsigned int i = 0;

cout<<i--;
}

A-0

B - Compile error

https://www.tutorialspoint.com/cplusplus/cpp_online_quiz.htm 2/3
9/5/2017 C++ Online Quiz - TutorialsPoint

C - 65535

D - 32767

Show Answer

Q 8 - What is the output of the following program?

#include<iostream>

using namespace std;


main() {
int r, x = 2;

float y = 5;

r = y%x;
cout<<r;
}

A-1

B-0

C-2

D - Compile error

Show Answer

Q 9 - Choose the invalid identifier from the below

A - Int

B - bool

C - DOUBLE

D - __0__

Show Answer

Q 10 - i) Exceptions can be traced and controlled using conditional statements.

ii) For critical exceptions compiler provides the handler

A - Only (i) is true

B - Only (ii) is true

C - Both (i) & (ii) are true

D - Both (i) && (ii) are false

Show Answer

Questions Page Next Quiz

Advertisements

Write for us FAQ's Helping Contact


Copyright 2017. All Rights Reserved.

https://www.tutorialspoint.com/cplusplus/cpp_online_quiz.htm 3/3

You might also like