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.

31. If an array is declared as
int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________.
a. 3, 2
b. 0, 2
c. 3, 0
d. 0, 4
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).3, 0

32. Mechanism of deriving a class from another derived class is known as____
a. Polymorphism
b. Single Inheritance
c. Multilevel Inheritance
d. Message Passing
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Multilevel Inheritance

33. RunTime Polymorphism is achieved by ______
a. friend function
b. virtual function
c. operator overloading
d. function overloading
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).virtual function

34. A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is __________
a. call by name
b. call by value
c. call by reference
d. call by value result
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).call by value

35. In C++, dynamic memory allocation is accomplished with the operator ____
a. new
b. this
c. malloc()
d. delete
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).new

36. If we create a file by ‘ifstream’, then the default mode of the file is _________
a. ios :: out
b. ios :: in
c. ios :: app
d. ios :: binary
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).ios :: in

37. A variable defined within a block is visible
a. from the point of definition onward in the program.
b. from the point of definition onward in the function.
c. from the point of definition onward in the block.
d. throughout the function.
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).from the point of definition onward in the block.

38. The break statement causes an exit
a. from the innermost loop only.
b. only from the innermost switch.
c. from all loops & switches.
d. from the innermost loop or switch.
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).from the innermost loop or switch.

39. Which of the following cannot be legitimately passed to a function
a. A constant
b. A variable
c. A structure
d. A header file
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).A header file

40. A property which is not true for classes is that they
a. are removed from memory when not in use.
b. permit data to be hidden from other classes.
c. bring together all aspects of an entity in one place.
d. can closely model objects in the real world.
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).bring together all aspects of an entity in one place.

Page 4 of 26