CS201 QUIZ NO 2 SOLVED 100% VERIFIED BY ADMIN (FINAL TERM SYLLABUS)
Q1: When operator function is implemented as member function then return type of function __________.
A) Must be an object of same class (100% Sure)
B) Must be user-defined data type
C) Must be built-in data type
D) Can be any data type
Q2: Suppose int i = 10; then what is the output of cout<< oct << i;
A) 10
B) 11
C) 12 (100% Sure)
D) 13
Q3: What is the sequence of event(s) when allocating memory to an object using new operator?
A) Only block of memory is allocated for object
B) Only constructors is called for object
C) Memory is allocated first before calling constructor (100% Sure)
D) Constructor is called first before allocating memory
Q4: When we use cin stream to read some number from the keyboard and store it in the integer variable, then what will happen?
A) Its binary representation will be ignored and the character will be stored
B) Its binary representation will be ignored and the value will be stored (100% Sure)
C) Its ASCII code will be stored inside the computer
D) Some error will occur and cin stream will detect this error
Q5: Let suppose
a = b = c
In such situation, it is necessary to return a reference of an object from assignment operator function.
A) True (100% Sure)
B) False
Q6: If we use cin stream to read some value and store it in some integer variable and press some alphabet key instead of numeric keys. then what will happen?
A) Its binary representation will be ignored and the character will be stored
B) Its binary representation will be ignored and the value will be stored
C) Its ASCII code will be stored inside the computer
D) Some error will occur and cin stream will detect this error (100% Sure)
Q7: What is the sequence of event(s) when deallocating memory of an object using delete operator?
A) Only block of memory is deallocated for object
B) Only destructor is called for object
C) Memory is deallocated first before calling destructor
D) Destructor is called first before deallocating memory (100% Sure)
Q8: Operator overloading is to allow the same operator to be bound to more than one implementation, depending on the types of the __________.
A) Compilers
B) Operands (100% Sure)
C) Function names
D) Applications
Q9: We can delete an array of objects without specifying [] brackets if a class is not doing dynamic memory allocation internally.
A) True (100% Sure)
B) False
Q10: __________ operators are the ones that require only one operator to work.
A) Unit
B) Unary (100% Sure)
C) Single
D) None of the given options