A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

81. 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
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).both a and c

82. A static function
a. should be called when an object is destroyed
b. is closely connected with and individual object of a class
c. can be called using the class name and function name
d. is used when a dummy object must be created
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).can be called using the class name and function name

83. We can output text to an object of class ostream using the insertion operator<< because
a. the ostream class is a stream
b. the insertion operator works with all classes
c. we are actually outputting to cout
d. the insertion operator is overloaded in ostream
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).the insertion operator is overloaded in ostream

84. The statement f1.write((char*)&obj1, sizeof(obj1));
a. Writes the member function of obj1 to f1
b. Writes the data in obj1 to f1
c. Writes the member function and the data of obj1 to f1
d. Writes the address of obj1 to f1
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).Writes the data in obj1 to f1

85. To convert from a user defined class to a basic type, you would most likely use
a. A built-in conversion function
b. A one-argument constructor
c. A conversion function that’s a member of the class
d. An overloaded ‘=‘ operator
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).A conversion function that’s a member of the class

86. Which of the following is not the characteristic of constructor.
a. They should be declared in the public section
b. They do not have return type
c. They can not be inherited
d. They can be virtual
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).They can be virtual

87. Name the header file to be included for the use of built in function isalnum().
a. string.h
b. process.h
c. ctype.h
d. dos.h
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).ctype.h

88. A class defined within another class is:
a. Nested class
b. Inheritance
c. Containership
d. Encapsulation
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).Nested class

89. What will be the values of x, m and n after the execution of the following statements?
int x, m, n;
m = 10;
n = 15;
x = ++m + n++;
a. x=25, m=10, n=15
b. x=26, m=11, n=16
c. x=27, m=11, n=16
d. x=27, m=10, n=15
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).x=26, m=11, n=16

90. Which of the following will produce a value 10 if x = 9.7?
a. floor(x)
b. abs(x)
c. log(x)
d. ceil(x)
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).ceil(x)