C++ Concepts

1

In access control in a protected derivation, visibility modes will change as follows:

A. private, public and protected become protected
B. only public becomes protected.
C. public and protected become protected.
D. only private becomes protected.

2

How many constructors can a class have?

A. 0
B. 1
C. 2
D. Any Number

3

A template class

A. is designed to be stored in different containers
B. works with different data types
C. generates objects which must be identical
D. generates classes with different numbers of member functions.

4

What is the output of given code fragment?

int f=1, i=2;
while(++i<5)
f*=i;
cout<<f;
A. 12
B. 24
C. 6
D. 3

5

A pure virtual function is a virtual function that

A. has no body
B. returns nothing
C. is used in base class
D. both A and C