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
Every class contains _______________.
Choose an answer
Constructor
Destructor
Both a constructor and a destructor
None of the given options
Previous
Skip
Next
Question # 2
In C/C++ if we define an array of size eight (8) i.e. int Arr [8]; then the last element of this array will be stored at
Choose an answer
Arr[0]
Arr[8]
Arr[7]
Arr[-1]
Previous
Skip
Next
Question # 3
Memory allocated at run time is a system resource and it is the responsibility of _____ to de-allocate the memory.
Choose an answer
System
Programmer
User of program
None of given options
Previous
Skip
Next
Question # 4
Which of the following is correct way to initialize a variable x of int type with value 10?
Choose an answer
int x ; x = 10;
int x = 10;
int x, x = 10;
x = 10;
Previous
Skip
Next
Question # 5
Is used for ___________.
Choose an answer
calculation
reading
assigning value to variables
None of the given options.
Previous
Skip
Next
Question # 6
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 # 7
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
Question # 8
Like member functions, ______ can also access the private data members of a class.
Choose an answer
Non-member functions
Friend functions
Any function outside class
None of the given options
Previous
Skip
Next
Question # 9
The stream insertion and stream extraction operators are already overloaded for ______.
Choose an answer
User-defined data types
Built-in data types http://www.sstutor.com/cpp/stream1.htm
User-defined and built-in data types
None of the given options
Previous
Skip
Next
Question # 10
Which situation would require the use of a non-member overloaded operator?
Choose an answer
The overloaded operator is an Assignment operator
The left most operand is an object of a class
The left operand is built-in data type
The operator returns a reference
Previous
Skip
Next
Question # 11
The object _______________may be used both for file input and file output.
Choose an answer
fstream
ifstream
ofstream
none of the given options
Previous
Skip
Next
Back