More Classes
5th Class
6th Class
7th Class
8th Class
9th Class
10th Class
11th Class
12th Class
NAT I
NAT II
CSS
IQ
General Knowledge
MDCAT
ECAT
GAT General
GAT Subject
Other Links
Go to Home
Online Tests
CS-201 Final Term Exams Preparation Virtual University MCQs With Answers
Question # 1
The statement cin.get (); is used to,
Choose an answer
Read a string from keyboard
Read a character from keyboard
Read a string from file
Read a character from file
Previous
Skip
Next
Question # 2
&& is -------------------- operator.
Choose an answer
An arithmetic
Logical
Relational
Unary
Previous
Skip
Next
Question # 3
Which of the following statement is best regarding declaration of friend function?
Choose an answer
Friend function must be declared after public keyword
Friend function must be declared after private keyword
Friend function must be declared at the top within class definition
It can be declared anywhere in class as these are not affected by the public and private keywords
Previous
Skip
Next
Question # 4
With user-defined data type variables (Objects), self assignment can produce.
Choose an answer
Syntax error
Logical error
Link error
Non of the given options
Previous
Skip
Next
Question # 5
When an object of a class is defined inside an other class then
Choose an answer
Constructor of enclosing class will be called first
Constructor of inner object will be called first
Constructor and Destructor will be called simultaneously
None of the given options
Previous
Skip
Next
Question # 6
What will be the correct syntax to access the value of fourth element of an array using pointer ptr?
Choose an answer
ptr[3]
(ptr+3)
*(ptr+3)
Both 1and 3
Previous
Skip
Next
Question # 7
Overloaded new operator function takes parameter of type size_t and returns
Choose an answer
void (nothing)
void pointer
object pointer
int pointer
Previous
Skip
Next
Question # 8
Classes defined inside other classes are called ________ classes.
Choose an answer
looped
nested
overloaded
none of the given options
Previous
Skip
Next
Question # 9
Which one of the following is the declaration of overloaded pre-increment operator implemented as member function?
Choose an answer
Class-name operator +()
Class-name operator +(int)
Class-name operator ++() ;
Class-name operator ++(int) ;
Previous
Skip
Next
Question # 10
When a value is referred by a normal variable then it is known as,
Choose an answer
Direct Reference
Indirect Reference
Partial Reference
Proper Reference
Previous
Skip
Next
Question # 11
The return type of the operator function for << operator is __________.
Choose an answer
class for which we overload operator
reference of ostream class (ostream&)
reference of istream class (istream&)
void
Previous
Skip
Next
Back