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 function is used to increase the size of already allocated memory chunk?
Choose an answer
malloc
calloc
realloc
free
Previous
Skip
Next
Question # 2
When an array is passed to a function then default way of passing this array is
Choose an answer
By data
By reference
By value
By data type
Previous
Skip
Next
Question # 3
Unary operator implemented as member function takes ____ arguments whereas non-member function takes _____ arguments.
Choose an answer
One, zero
Zero, one
One, two
Two, one
Previous
Skip
Next
Question # 4
Which of the following function call is correct for the function prototype? defaultParameters ( int a, int b = 7, char z = ‘*’ );
Choose an answer
defaultParameters (5);
defaultParameters (5, ‘8’);
defaultParameters (6, ‘#’);
defaultParameters (0, 0, ‘*’, 0);
Previous
Skip
Next
Question # 5
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 # 6
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 # 7
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
Question # 8
To include code from the library in the program, such as iostream, a directive would be called up using this command.
Choose an answer
#include “iostream.h”
include <iostream.h>
include <iostream.h>
#include <iostream.h>
Previous
Skip
Next
Question # 9
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 # 10
Consider the following code segment. What will be the output of following code? Int addValue (int *a){ int b = (*a) + 2; return b ; } main () { int x =6 ; cout << x << “,” ; cout << addValue(&x) << “,” ; cout << x ; }.
Choose an answer
6,8,6
6,6,8
6,8,8
6,6,6
Previous
Skip
Next
Question # 11
*.doc is _____________ by type.
Choose an answer
Sequential File
Random Access File
Data File
Record File
Previous
Skip
Next
Back