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
The endl and flush are _______
Choose an answer
Functions
Operators
Manipulators
Objects
Previous
Skip
Next
Question # 2
Which of the following is NOT a preprocessor directive?
Choose an answer
#error
#define
#line
#ndefine
Previous
Skip
Next
Question # 3
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 # 4
What does STL stand for?
Choose an answer
Source template library
Standard template library
Stream template library
Standard temporary library
Previous
Skip
Next
Question # 5
When an operator function is defined as member function for a binary Plus (+) operator then the number of argument it take is/are
Choose an answer
Zero
One
Two
N arguments
Previous
Skip
Next
Question # 6
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 # 7
When an object of a class is defined inside an other class then
Choose an answer
Constructor of enclosing class will be called first
Constructor of inner object will be called first
Constructor and Destructor will be called simultaneously
None of the given options
Previous
Skip
Next
Question # 8
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 # 9
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 # 10
Is used for ___________.
Choose an answer
calculation
reading
assigning value to variables
None of the given options.
Previous
Skip
Next
Question # 11
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 # 12
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 # 13
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 # 14
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 # 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
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 # 17
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 # 18
Array is a data structure which store
Choose an answer
Memory addresses
Variables
Data Type
Data
Previous
Skip
Next
Back