Top 1,000+ C++ Language Quiz Questions & Answers - 2

Question: 6

A C++ stream is

(A) Associated with a particular class

(B) Flow of control through a function

(C) A file

(D) A flow of data from one place to another

Ans: D

A flow of data from one place to another

Question: 7

The keyword volatile is used to declare

(A) Objects that can be modified outside of a program control

(B) Absence of a type

(C) A member function that is defined in a subclass

(D) All of these

Ans: A

Objects that can be modified outside of a program control

Question: 8

In C language, the break statement causes an exit

(A) Only from the innermost switch

(B) Only from the innermost loop

(C) From all loops and switches

(D) From the innermost loop or switch

Ans: D

From the innermost loop or switch

Question: 9

In a for loop with a multi-statement, loop body semicolons should appear

(A) The test expression

(B) Each statement within the loop body

(C) The closing brace in a multi-statement loop body

(D) Both (a) and (b)

Ans: D

Both (a) and (b)

Question: 10

In C++, when an argument is passed by reference

(A) A variable is created in the function to hold the argument’s value

(B) A temporary variable is created in the calling program to hold the argument’s value

(C) The function cannot access the argument’s value

(D) The function accesses the argument’s original value in the calling program

Ans: A

A variable is created in the function to hold the argument’s value

Related Questions