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.

21. The address of a variable temp of type float is
a. *temp
b. &temp
c. float& temp
d. float temp&
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).&temp

22. What is the output of the following code :
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];
a. a b c
b. “abc”
c. abc
d. ‘abc’
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).abc

23. The process of building new classes from existing one is called ______.
a. Polymorphism
b. Structure
c. Inheritance
d. Cascading
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Inheritance

24. If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access
a. protected and public data only in C and B
b. protected and public data only in C
c. private data in A and B
d. protected data in A and B
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).protected data in A and B

25. If the variable count exceeds 100, a single statement that prints “Too many” is
a. if (count<100) cout << “Too many”;
b. if (count>100) cout >> “Too many”;
c. if (count>100) cout << “Too many”;
d. None of these
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).if (count>100) cout << “Too many”;

26. Usually a pure virtual function
a. has complete function body
b. will never be called
c. will be called only to delete an object
d. is defined only in derived class
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).is defined only in derived class

27. To perform stream I/O with disk files in C++, you should
a. open and close files as in procedural languages.
b. use classes derived from ios.
c. use C language library functions to read and write data.
d. include the IOSTREAM.H header file.
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).use classes derived from ios.

28. Overloading the function operator
a. requires a class with an overloaded operator.
b. requires a class with an overloaded [ ] operator.
c. allows you to create objects that act syntactically like functions.
d. usually make use of a constructor that takes arguments.
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).requires a class with an overloaded operator.

29. In C++, the range of signed integer type variable is ________
a. 0 to 2^16
b. - 2^15 to 2^15-1
c. -2^7 to 2^7-1
d. 0 to 2^8
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).- 2^15 to 2^15-1

30. If x = y,5 = 2 then x ∧ y equals________.

(where ∧ is a bitwise XOR operator)
a. 00000111
b. 10000010
c. 10100000
d. 11001000
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).00000111

Page 3 of 26