CS201 Final Term Solved Past Papers By Moaz
Question No: 1 ( Marks: 1 ) - Please choose
one
All A template function must have at least ---------- generic data
type
â–º Zero
â–º One (Page 499)
â–º Two
â–º Three
Question No: 2 ( Marks: 1 ) – Please choose
one
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. (Page
346)
Question No: 3 ( Marks: 1 ) - Please choose
one
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 ++() ; (Page 389)
â–º Class-name operator ++(int) ;
Question No: 4 ( Marks: 1 ) - Please choose
one
Class is a user defined___________.
â–º data type (Page 317)
â–º memory referee
â–º value
â–º none of the given options.
Question No: 5 ( Marks: 1 ) - Please choose
one
How many
bytes will the pointer intPtr of type int move in the following statement?
intPtr += 3 ;
â–º 3 bytes
â–º 6 bytes
â–º 12 bytes
â–º 24 bytes
Question No: 6 ( Marks: 1 ) - Please choose
one
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];
Question No: 7 ( Marks: 1 ) - Please choose
one
A Pointer is a special variable that contain
â–º Data values
â–º Memory Address (Page 267)
â–º Both data and values
â–º None of the given option
Question No: 8 ( Marks: 1 ) - Please choose
one
Reference Value Type Data The code is written to __________ the
program.
â–º implement
â–º design
â–º analysis
â–º none of the given options
Question No: 9 ( Marks: 1 ) - Please choose
one
Which of the following function is used to increase the size of
already allocated memory chunk?
â–º malloc
â–º calloc
â–º realloc (Page 285)
â–º free
Question No: 10 ( Marks: 1 ) - Please choose
one
Which of the following is NOT a preprocessor directive?
â–º #error
â–º #define
â–º #line
â–º #ndefine (Page 272)
Question No: 11 ( Marks: 1 ) – Please choose
one
The stream objects cin and cout are
included in which header file?
â–º iostream.h (Page 15)
â–º fstream.h
â–º istream.h
â–º ostream.h
Question No: 12 ( Marks: 1 ) – Please choose
one
Overloaded delete operator function takes the same parameter as an
argument returned by new operator
function.
â–º True (Page 414)
â–º False
Question No: 13 ( Marks: 1 ) – Please choose
one
When an array of object is created dynamically then there is no
way to provide parameterized constructors
for array of objects.
â–º True (Page 414)
â–º False
Question No: 14 ( Marks: 1 ) - Please choose
one
Computer can understand only machine language code.
â–º True
â–º False
Question No: 15 ( Marks: 1 ) - Please choose
one
We can not define a function as a friend of a Template class.
â–º True
â–º False (Page 151)
Class templates can have friends. A class or class template,
function, or function template can be a friend to
a template class. Friends can also be specializations of a class
template or function template, but not partial
specializations.
Question No: 16 ( Marks: 1 ) – Please choose
one
What will be the value of ‘a’ and ‘b’ after
executing the following statements?
A = 3;
b = a++;
â–º 3,
4
â–º 4,
4
â–º 3,
3
â–º 4, 3
Question No: 17 ( Marks: 1 ) – Please choose
one
_______ is used to trace the logic of the program and correct the
logical errors.
â–º Compiler
â–º Editor
â–º Linker
â–º Debugger (Page 13)
Question No: 18 ( Marks: 1 ) - Please choose
one
new and delete are _____ whereas malloc and free are _____.
â–º Functions,
operators
â–º Classes,
operators
â–º Operators, functions (Page 342-285)
â–º Operators, classes
Question No: 19 ( Marks: 1 ) - Please choose
one
Like member functions, ______ can also access the private data
members of a class.
â–º Non-member
functions
â–º Friend functions (Page 346)
â–º Any
function outside class
â–º None
of the given options
Question No: 20 ( Marks: 1 ) – Please choose
one
Which situation would require the use of a non-member overloaded
operator?
â–º The
overloaded operator is an Assignment operator.
â–º The left most operand is an object of a
class.(Page 375)
â–º The
left operand is built-in data type.
â–º The operator returns a
reference.
Clink On Link Given Below For Download Complete File Of CS201 MCQS
No comments:
Post a Comment