Object Oriented Programming Using C++ - Section 3 Multiple Questions and Answers.




21.Which of the following is the best function prototype for an overloaded ........... for a Number class?
A. Number operator-(const Number & num)
B. Number & operator-(int num)
C. int Number (operator-())
D. void operator-(Number & num)

22. If » operator is overloaded properly for use for input with a number class, and a and bare member of the Number class, which of the following statements allowed?
A. cin >>a
B. cin >> a,b
C. Both (a) and (b)
D. None of these

23.Assume num = 8; the value of expression num++ is:
A. 7
B. 8
C. 9
D. Impossible to tell

24.If ++ operator is overloaded properly, then operator ++ () function returns:
A. a copy of an incremented member of a class
B. a copy of an incremented data item
C. a reference to a class member data item
D. this pointer

25.The « operator is used for output only when:
A. it is used as a binary operator
B. it is used as a unary operator
C. cout is to the left
D. you write a function to overload it.

«»



Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers