Computer Science Study Materials for Competitive Exams

Sample Questions, Previous Year Solved Papers, Study Materials For Competitive Examinations Like UGC NET, SET And GATE Computer Science.

Saturday, 5 August 2017

C & C++ Programming Multiple Choice Questions - Set 46

1.       The operator << when overloaded in a class
(A) must be a member function
(B) must be a non member function
(C) can be both (A) & (B) above
(D) cannot be overloaded
Answer: C
2.       The expression, a = 30 * 1000 + 2768 ; evaluates to
(A) 32768
(B) -32768
(C) 113040
(D) 0
Answer: A
3.       Within a switch statement
(A) Continue can be used but Break cannot be used
(B) Continue cannot be used but Break can be used
(C) Both Continue and Break can be used
(D) Neither Continue nor Break can be used
Answer: B
4.       Data members which are static
(A) cannot be assigned a value
(B) can only be used in static functions
(C) cannot be defined in a Union
(D) can be accessed outside the class
Answer: B
5.       Which of the following is false for cin?
(A) It represents standard input.
(B) It is an object of istream class.
(C) It is a class of which stream is an object.
(D) Using cin the data can be read from user’s terminal.
Answer: C

6.       Which of the following statements is NOT valid about operator overloading?
(A) Only existing operators can be overloaded.
(B) Overloaded operator must have at least one operand of its class type.
(C) The overloaded operators follow the syntax rules of the original operator.
(D) none of the above.
Answer: D
7.       Exception handling is targeted at
(A) Run-time error
(B) Compile time error
(C) Logical error
(D) All of the above.
Answer: A
8.       A pointer to the base class can hold address of
(A) only base class object
(B) only derived class object
(C) base class object as well as derived class object
(D) None of the above
Answer: C
9.       Function templates can accept
(A) any type of parameters
(B) only one parameter
(C) only parameters of the basic type
(D) only parameters of the derived type
Answer: C
10.    How many constructors can a class have?
(A) 0
(B) 1
(C) 2
(D) any number
Answer: D

No comments:

Post a Comment