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
Friend function of a class is ______________
Choose an answer
Member function
Non-member function
Private function
Public function
Previous
Skip
Next
Question # 2
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 # 3
How many bytes will the pointer intPtr of type int move in the following statement? intPtr += 3 ;
Choose an answer
3 bytes
6 bytes
12 bytes
24 bytes
Previous
Skip
Next
Question # 4
All A template function must have at least ---------- generic data type.
Choose an answer
Zero
One
Two
Three
Previous
Skip
Next
Question # 5
Classes defined inside other classes are called ________ classes.
Choose an answer
looped
nested
overloaded
none of the given options
Previous
Skip
Next
Question # 6
A Matrix can be composed of ints, floats or doubles as their elements. Best way is to handle this _______________
Choose an answer
Write a separate class to handle each
Use templates
Use strings to store all types
None of the given options
Previous
Skip
Next
Question # 7
What will be the correct syntax to declare two-dimensional array of float data type?
Choose an answer
float arr{2}{2} ;
float arr[2][2] ;
float arr[2,2] ;
float[2][2] arr ;
Previous
Skip
Next
Question # 8
The operator function overloaded for an Assignment operator (=) must be.
Choose an answer
Non-member function of class
Member function of class
Friend function of class
None of the given options
Previous
Skip
Next
Question # 9
When ever dynamic memory allocation is made in C/C++, it is freed_____________.
Choose an answer
Explicitly
Implicitly
Both explicitly and implicitly
None of the given options
Previous
Skip
Next
Question # 10
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
Question # 11
What is the sequence of event(s) when allocating memory using new operator?
Choose an answer
Only block of memory is allocated for objects
Only constructor is called for objects
Memory is allocated first before calling constructor
Constructor is called first before allocating memory
Previous
Skip
Next
Back