1000+ C++ Questions and Answers Pdf - 1

Question: 1

The library function exit( ) causes an exit from

(A) The program in which it occurs

(B) The function in which it occurs

(C) The block in which it occurs

(D) The loop in which it occurs

Ans: A

The program in which it occurs

Question: 2

The dot operator connects which of the following two entities?

(A) Class object and member of that class

(B) Class and member of that class

(C) Class object and a class

(D) Class member and class object

Ans: A

Class object and member of that class

Question: 3

A static function

(A) Should be called when an object is destroyed

(B) Can be called using the class name and function

(C) Is closely connected with an individual object of a class

(D) Is used when a dummy object must be created

Ans: B

Can be called using the class name and function

Question: 4

The function bad( ) is declared in the header file

(A) <iostream.h>

(B) <stdio.h>

(C) <math.h>

(D) <stdlib.h>

Ans: C

<math.h>

Question: 5

In C++, a function contained within a class is called

(A) A method

(B) A class function

(C) Member function

(D) None of these

Ans: C

Member function

Related Questions