Online Exam Preparation

MCQs Library

Browse subject-wise multiple choice questions, review answers quickly, and start a test from the same section.

Course Codes

Select a course to load its MCQs.

Selected: CS201 225 MCQs
CS101 533 CS201 225 CS301 232 CS302 174 CS304 192 CS401 224 CS402 258 CS403 228 CS408 113 CS411 121 CS502 249 CS504 268 CS601 679 CS604 381 CS605 261 CS607 184 CS609 230 CS610 300 CS614 100 CS703 65

Questions

Showing page 11 of 12

Code Question Option A Option B Option C Option D Answer
CS201
When We Do Dynamic Memory Allocation In The Constructor Of A Class Then It Is Necessary To Provide A Destructor.
True
False
A
CS201
When We Use Manipulators In Our Program Then Which Header File Should Be Included?
Iostream.H
Stdlib.H
Stdio.H
Iomanip.H
D
CS201
When We Write A Class Template The First Line Must Be:
Template < Class Class_Type>
Template < Class Data_Type>
Template < Class T > Here T Can Be Replaced With Any Name But It Is Preferable.
Class Class-Name()
C
CS201
When X = 7; Then The Expression X%= 2; Will Calculate The Value Of X As
1
3
7
2
A
CS201
Whenever New Operator Is Used No Number Of Bytes Or Sizeof Operator Is Required.
True
False
A
CS201
Where We Can Include A Header File In The Program?
Any Where
In Start
At The End
None Of The Given Options.
B
CS201
Which Looping Process Checks The Test Condition At The End Of The Loop?
For
While
Do While
No Looping Process Checks The Test Condition At The End
C
CS201
Which Of The Following Data Type Will Be Assumed If No Data Type Is Specified With Constant?
Short
Float
Int
Double
C
CS201
Which Of The Following Is A Valid Class Declaration?
Class A { Int X; };
Class B { }
Public Class A { }
Object A { Int X; };
A
CS201
Which Of The Following Is Correct Way To Initialize A Variable X Of Int Type With Value 10?
Int X ; X = 10 ;
Int X = 10 ;
Int X X = 10;
X = 10 ;
B
CS201
Which Of The Following Is The Correct C++ Syntax To Allocate Space Dynamically For An Array Of 10 Int?
New Int(10) ;
New Int[10] ;
Int New(10) ;
Int New[10];
B
CS201
Which Of The Following Is The Correct Statement For The Following Declaration? Const Int *Ptr.
Ptr Is A Constant Pointer
Ptr Is Constant Integer Pointer
Ptr Is A Constant Pointer To Int
Ptr Is A Pointer To Const Int
D
CS201
Which Of The Following Is The Correct Way To Assign An Integer Value 5 To Element Of A Matrix Say ‘M’ At Second Row And Third Column?
M[2][3] = 5 ; // [Row][Col]
M[3][2] = 5 ;
M[1][2] = 5 ;
M[2][3] = ‘5’;
A
CS201
Which Of The Following Is True While Overloading Operators?
Precedence Of An Operator Can Be Changed
The Parity (Number Of Operands) Can Be Changed
No New Operators Can Be Created
Associativity Of An Operator Can Be Changed
A
CS201
Which Of The Following Operators Can Not Be Overloaded?
New
Delete
+=
Sizeof
D
CS201
Which Of The Following Option Is True About New Operator To Dynamically Allocate Memory To An Object?
The New Operator Determines The Size Of An Object
Allocates Memory To Object And Returns Pointer Of Valid Type
Creates An Object And Calls The Constructor To Initialize The Object
All Of The Given Options
B
CS201
Which Of The Following Option Will Be True To Overload The -= Operator?
Minus (-) And = Operators Need To Be Overloaded
The -= Operator Need To Be Overloaded Explicitly
The - And = Operators Need To Be Overloaded Implicitly
Non Of Given
C
CS201
Which Of The Following Statement Is Best Regarding Declaration Of Friend Function?
Friend Function Must Be Declared After Public Keyword.
Friend Function Must Be Declared After Private Keyword.
Friend Function Must Be Declared At The Top Within Class Definition.
It Can Be Declared Anywhere In Class As These Are Not Affected By The Public And Private Keywords.
D
CS201
Which One Of The Following Is The Declaration Of Overloaded Pre-Increment Operator Implemented As Member Function?
Class-Name Operator +() ;
Class-Name Operator +(Int) ;
Class-Name Operator ++() ;
Class-Name Operator ++(Int) ;
C
CS201
Which One Of The Following Operators Is A Unary Operator?
Or ( || )
And ( &&)
Xor ( ^ )
Complement Operator ( ~ )
D