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
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 # 2
When we use manipulators in our program then which header file should be included?
Choose an answer
iostream.h
stdlib.h
stdio.h
iomanip.h
Previous
Skip
Next
Question # 3
If we define an identifier with the statement #define PI 3.1415926 then during the execution of the program the value of PI __________.
Choose an answer
can not be replaced
None of the given options
Remain constant
can be changed by some operation
Previous
Skip
Next
Question # 4
A Pointer is a special variable that contain.
Choose an answer
Data values
Memory Address
Both data and values
None of the given option
Previous
Skip
Next
Question # 5
The function free() returns back the allocated memory got thorough calloc andmalloc to _____.
Choose an answer
stack
heap
stack and heap
None of the given options
Previous
Skip
Next
Question # 6
Classes defined inside other classes are called ________ classes.
Choose an answer
looped
nested
overloaded
none of the given options
Previous
Skip
Next
Question # 7
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 # 8
What purpose do classes serve?
Choose an answer
Data encapsulation
Providing a convenient way of modeling real-world objects
Simplifying code reuse
All of the given options
Previous
Skip
Next
Question # 9
Friend functions are _____ of a class
Choose an answer
Member functions
Public member functions
Private member functions
Non-member functions
Previous
Skip
Next
Question # 10
What does (*this) represents?
Choose an answer
The current function of the class
The current pointer of the class
The current object of the class
A value of the data member
Previous
Skip
Next
Question # 11
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
Back