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 functions are _____ of a class
Choose an answer
Member functions
Public member functions
Private member functions
Non-member functions
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
Class is a user defined___________.
Choose an answer
Data type
Memory referee
Value
None of the given options
Previous
Skip
Next
Question # 4
Is used for ___________.
Choose an answer
calculation
reading
assigning value to variables
None of the given options.
Previous
Skip
Next
Question # 5
Friend function of a class is ______________
Choose an answer
Member function
Non-member function
Private function
Public function
Previous
Skip
Next
Question # 6
All A template function must have at least ---------- generic data type.
Choose an answer
Zero
One
Two
Three
Previous
Skip
Next
Question # 7
The programs, in which we allocate static memory, run essentially on ________
Choose an answer
Heap
System Cache
None of the given options
Stack
Previous
Skip
Next
Question # 8
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 # 9
In if structure the block of statements is executed only.
Choose an answer
When the condition is false
When it contain arithmetic operators
When it contain logical operators
When the condition is true
Previous
Skip
Next
Question # 10
While calling function, the arguments are assigned to the parameters from _____________.
Choose an answer
left to right
right to left
no specific order is followed
none of the given options
Previous
Skip
Next
Question # 11
If text is a pointer of class String then what is meant by the following statement? text = new String [5];
Choose an answer
Creates an array of 5 string objects statically
creates an array of 5 string objects dynamically
Creates an array of pointers to string
Creates a string Object
Previous
Skip
Next
Question # 12
"new" and "delete" keywords are _____________ in C++ language
Choose an answer
Built-in- Function
Operators
Memory Allocation Function
None of the given options
Previous
Skip
Next
Question # 13
new and delete are _____ whereas malloc and free are _____.
Choose an answer
Functions, operators
Classes, operators
Operators, functions
Operators, classes
Previous
Skip
Next
Question # 14
Which character is inserted at the end of string to indicate the end of string?
Choose an answer
new line
tab
null
carriage return
Previous
Skip
Next
Question # 15
The first parameter of operator function for << operator,
Choose an answer
Must be passed by value
Must be passed by reference
Can be passed by value or reference
Must be object of class
Previous
Skip
Next
Question # 16
C is widely known as development language of _______ operating system.
Choose an answer
Linux
Windows
Unix
Mac OS
Previous
Skip
Next
Question # 17
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 # 18
Which of the following is NOT a preprocessor directive?
Choose an answer
#error
#define
#line
#ndefine
Previous
Skip
Next
Back