CS201 – Introduction To Programming Mcqs Pdf with Answers Part 04


151      Default mechanism of function calling in case of array is _____ and in case of variable is ___.

► Call by value, call by reference

► Call by referene, call by reference

► Call by reference, call by value

► Call by value, call by value


152      What does STL stand for?

► Source template library 

► Standard template library

► Stream template library

► Standard temporary library\


153      Skill(s) that is/are needed by programmer’s _______________________.

► Paying attention to detail

► Think about the reusability

► Think about user interface

► All of the given options


154        For which array, the size of the array should be one more than the number of elements in an array?

► int

► double

► float

► char


155      new and delete are _____ whereas malloc and free are _____.

► Functions, operators

► Classes, operators

► Operators, functions

► Operators, classes


156        Friend functions are _____ of a class.

► Member functions

► Public member functions

► Private member functions

► Non-member functions


157      The prototype of friend functions must be written ____ the class and its definition must be written ____

► inside, inside the class

► inside, outside the class

► outside, inside the class

► outside, outside the class


158      If overloaded plus operator is implemented as non-member function then which of the following statement will be true for the statement given below? obj3 = obj1 + obj2 ;

► obj2 will be passed as an argument to + operator whereas obj2 will  drive the + operator

► obj1 will drive the + operator whereas obj2 will be passed as an argument to + operator

► Both objects (obj1, obj2) will be passed as arguments to the + operator (not sure)

► Any of the objects (obj1, obj2) can drive the + operator


159      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) ;


160      For cin, the source is normally a ________ and destination can be ______.

► File, native data type

► Disk, user-define type

► Keyboard, variable


161      For cin, the source is normally keyboard and the destination can be an ordinary variable

► File, user-define type


162         We can also do conditional compilation with preprocessor directives.

► True

► False


163      The programs, in which we allocate static memory, run essentially on ________

► Heap

► System Cache

► None of the given options

► Stack


164      The default value of a parameter can be provided inside the ________________

► function prototype

► function definition

► both function prototype or function definition

► none of the given options.


165      While calling function, the arguments are assigned to the parameters from _____________.

► left to right.

► right to left

► no specific order is followed

► none of the given options.


166      When an operator function is defined as member function for a binary Plus (+) operator then the number of argument it take is/are.

► Zero

► One

► Two 

► N arguments


167      With user-defined data type variables (Objects), self assignment can produce __________.

► Syntax error

► Logical error

► Link error

► Non of the given options (not sure)


168      Assignment operator is used to initialize a newly declared object from existing object.

► True

► False


169      When an object of a class is defined inside an other class then,

► 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


170      In the member initializer list, the data members are initialized,

► From left to right

► From right to left

► In the order in which they are defined within class

► None of the given options


171      new operator allocates memory from free store and return _____________.

► A pointer

► A reference

► An integer

► A float


172      “new” and “delete” keywords are _____________ in C++ language.

► Built-in- Function

► Operators

► Memory Allocation Function

► None of the given options


173      && is ——————– operator.

► An arithmetic

► Logical

► Relational

► Unary


174      Which of the following function(s) is/are included in ctype.h header file?

► isdigit(int c)

► isxdigit(int c )

► tolower(int c)

► All of the above


175      Disks are _______________ devices having access time of _________ milliseconds.

► Electro-physical, 6

► Electro-Mechanical, 4

► Electro-physical, 5

► Electro-Mechanical, 7


176      All preprocessor directives are started with the symbol______.

► *

30

► ++

► @

► #


177      When we use manipulators in our program then which header file should be included?

► iostream.h

► stdlib.h

► stdio.h

► iomanip.h


178      setprecision is a parameter less manipulator.

► True

► False


179      Which of the following is NOT a preprocessor directive?

► #error

► #define

► #line

► #ndefine


180      We can do arithmetic with references like pointers.

► True

► False


181        What does (*this) represents?

► The current function of the class

► The current pointer of the class

► The current object of the class 

► A value of the data member


182        Friend function of a class is ______________ .

► Member function

► Non-member function

► Private function

► Public function


183        A function can declare itself a friend of a class. 

► True

► False


184      Overloaded delete operator function takes the same parameter as an argument returned by new operator function.

► True

► False


185      The second parameter of operator functions for << and >> are objects of the class for which we are overloading these operators.

► True

► False

The second parameter to operator << is an object of the class that we are overloading the operator for. Similar is the case for operator >>


 186     A template function must have at least ———- generic data type

► Zero

► One

► Two

► Three


187      A template function must have only generic data types.

► True

► False


188      We can not make a member function of a class as template function.

► True

► False


189      Which character is inserted at the end of string to indicate the end of string?

► new line

► tab

► null

► carriage return


190      is used for ___________.

► calculation

► reading

► assigning value to variables 

► None of the given options.


191      vuzs The object _______________may be used both for file input and file output

► fstream,

► ifstream,

► ofstream,

► none of the given options.


192      Which of the following function calling mechanism is true for the function prototype given below? float func(float &);

► Call by value

► Call by reference using pointer

► Call by reference using reference variable

► None of the given options


193      The programs, in which we allocate static memory, run essentially on ________

► Heap

► System Cache

► None of the given options

► Stack


194      Overloaded delete operator function takes parameter of void pointer and returns ________.

► void

► void pointer

► pointer to an object

► pointer of type int


195      What should be the return type of the constructor?

► void pointer

► int

► same as object type

► constructors do not return any thing


196 It is a way of reusing the code when we contain objects of our already written classes into a new class,

► True

► False


197      vuzs Templates are not type safe.

► true

► false


198      The functions used for dynamic memory allocation return pointer of type ______

► int

► float

► void

► double


199  There are mainly ——————– types of software

► Two

► Three

► Four

► Five


200  seekg() and write() are functionally _________________ .

► Different

► Identical

► Two names of same function

► None of the above