C++ Programming Questions with Solutions - 1

Question: 1

The public files in a class library usually contain

(A) Variable definition

(B) Class declarations

(C) Constant definitions

(D) Member function definitions

Ans: B

Class declarations

Question: 2

The member function can always access the data in

(A) Any object of the class of which it is a member

(B) The public part of its class

(C) The class of which it is member

(D) The object of which is a member

Ans: D

The object of which is a member

Question: 3

In a stock, the data item placed on the stack first is

(A) Given as index zero

(B) Not given as index number

(C) The first data item to be removed

(D) The last data item to be removed

Ans: D

The last data item to be removed

Question: 4

Breaking a program into several files is desirable because

(A) A program can be divided functionally

(B) Each programmer can work on a separate file

(C) Some files don’t need to be recompiled each time

(D) Files can be marketed in object form

Ans: A

A program can be divided functionally

Question: 5

Turbo C++ library function can be used

(A) Draw lines and circles

(B) Write text in a variety of fonts and sizes

(C) Color any closed figure

(D) All of these

Ans: D

All of these

Related Questions