C Programming Online Test Questions and Answers - 1

Question: 1

A friend function can be used to

(A) allow one class to access an unrelated class

(B) allow access to classes whose source code is unavailable

(C) increase versatility of an over-loaded operator

(D) avoid arguments between classes

Ans: A

allow one class to access an unrelated class

Question: 2

The public files in a class library usually contain

(A) class declarations

(B) variable definitions

(C) member function definitions

(D) constant definitions

Ans: A

class declarations

Question: 3

In C++, the go to statement causes control to go to a/an

(A) an operator

(B) a variable

(C) a label

(D) a function

Ans: C

a label

Question: 4

In C++, when a multidimensional array is accessed, each array index is

(A) surrounded by brackets and separated by commas

(B) surrounded by brackets

(C) separated by commas and surrounded by brackets

(D) separated by commas

Ans: B

surrounded by brackets

Question: 5

A normal C++ operator that acts on special system on newly defined data types is called

(A) classified

(B) overloaded

(C) encapsulated

(D) glorified

Ans: B

overloaded

Related Questions