CS201 Quiz 30 Lectures

No Comments
Question No. 1
For costing, we normally declare a pointer of type _____________.
Void
NULL
we are going to use
integer

Question No. 2
Once the _______________ are created, they exist for the life time of the program
local variables
non static variables
static variables
automatic variables

Question No. 3
If we want to allocate memory to an array of 5 integers dynamically, the syntax will be _____________.
 int *iptr ;
           iptr = new int[5] ;

  integer iptr**  ;
    iptr= new int[5]

 int iptr ;
    iptr= int [5]


iptr= new[5]


Question No. 4
_______ Operators are the ones that require two operands on both sides of the operator.
Double
Tow sided
Binary
None of the given options


Question No. 5
Initializing the data member within the class is _____________.
a logical error
a run time error
a syntax error
not an error


Question No. 6
The reference data types are used as __________________ variables without any _______________ operator
ordinary  , deference
global , dot
static , deference
local , & 


Question No. 7
Class can be defined as :
A class includes both data members as well as functions to manipulate that data
A class includes only objects
A class includes both objects and structures
A class does not include data members and functions


Question No.8
The members of a class declared with the keyword struct are _____________by default.
static
private
protected
public


Question No. 9
___________ are not available in C language
User defined functions
Built in functions
Library functions
Inline functions


Question No. 10
When a problem is broken into small pieces or modules and each small piece corresponds to a function this technique is called__________________ approach

top-down structured programming
down-top structured programming
object oriented programming
middle level structured programming


Question No. 11
A pointer with value NULL is defined in the header files _____________and ___________.

conio.h ,iostream.h
conio.c ,getche()
stdlib.h ,stddef.h
process.h, stdi.h


Question No. 12
#define CIRCUMFERENCE(X) (2 * PI * R) is a
user defined function                   
library function
definition of a macro                  
utility function


Question No. 13
The function overloading requires__________________.
no arguments
the argument list to be the same
the arguments of integer type only
the argument list to be different.


Question No. 14
This reference to a variable can be obtained by preceding the identifier of a variable with ________________.
dot operator 
ampersand sign &
^ sign
* operator

All the preprocessors directives starts with ________.
$
&
#
_


Question No. 15
The dynamic memory allocation uses ___________ whereas static memory allocation uses _________.
heap , stack
stack , lists
array , stack
classes , array

Question No. 16
The friend keyword provides access _______________.

in one direction only
in two directions
to all classes
to the data members of the friend class only


Question No. 17
Default constructor generated by ______________does ______________for us.

compiler , initialization
compiler, no initialization
classes , initialization
main program, memory management

Question No. 18
A class is _____________.
 a built in function
a user defined data type
an array
a member function

Question No. 19
The friend functions are _____________.
not member of a class
member of a class
inline functions
void functions

Question No. 20
Identify the correct syntax for making a class friend of other class
class ClassOne
{
friend OtherClass ;
private:
//here we write the data members of ClassOne
};
-----------
    friend ClassOne
{
 OtherClass ;
private:
//here we write the data members of ClassOne
};
-----------
ClassOne
{
friend OtherClass ;
private:
//here we write the data members of ClassOne
};
----------
Friend class ClassOne
{
friend OtherClass ;
private:
//here we write the data members of ClassOne
};

------------

Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment