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
Classes defined inside other classes are called ________ classes.
Choose an answer
looped
nested
overloaded
none of the given options
Previous
Skip
Next
Question # 2
Which kind of functions can access private member variables of a class?
Choose an answer
Friend functions of the class
Private member functions of the class
Public member functions of the class
Friend, private and public functions
Previous
Skip
Next
Question # 3
What will be the value of ‘a’ and ‘b’ after executing the following statements?A = 3; b = a++;
Choose an answer
3, 4
4, 4
3, 3
4, 3
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
Which of the following is the correct C++ syntax to allocate space dynamically for an array of 10 int?
Choose an answer
new int(10)
new int[10] ;
int new(10) ;
int new[10];
Previous
Skip
Next
Question # 6
Which of the following function do NOT initialize the chunk of memory to all zero?
Choose an answer
calloc() function
Both malloc() and calloc()
None of the above
malloc() function
Previous
Skip
Next
Question # 7
NULL value has been defined in ______ and _________ header files.
Choose an answer
strings.h and iostream.h
ctype.h and conio.c
conio.c and conio.h
stdlib.h and stddef.h
Previous
Skip
Next
Question # 8
The prototype of friend functions must be written ____ the class and its definition must be written ____.
Choose an answer
inside, inside the class
inside, outside the class
outside, inside the class
outside, outside the class
Previous
Skip
Next
Question # 9
Consider the following code segment. What will be the output of the following program? int func(int) ; int num = 10 ; int main(){ int num ; num = 5 ; cout << num ; cout << func(num) ; } int func(int x){ return num ; }
Choose an answer
5, 5
10, 5
5, 10
10, 10
Previous
Skip
Next
Question # 10
Header file: fstream.h includes the definition of the stream classes __________.
Choose an answer
ifstream, fstream, cout
ifstream, fstream, ofstream
fstream, cin, cout
None of the above
Previous
Skip
Next
Question # 11
Pointer is a variable which store
Choose an answer
Data
Memory Address
Data Type
Values
Previous
Skip
Next
Back