suppose we
have int y[10]; To access the 4th element of the array we write_______
y[4];
y[3];
y[2];
none of given
From the following; which one is the range of Random number generator function rand()?
0 – 32768
1 – 32768
0 – 32767
1 – 32767
From following; which one is the correct syntax of an array initialize: Array size is 10 and it is of double data type to value 0?
y[4];
y[3];
y[2];
none of given
From the following; which one is the range of Random number generator function rand()?
0 – 32768
1 – 32768
0 – 32767
1 – 32767
From following; which one is the correct syntax of an array initialize: Array size is 10 and it is of double data type to value 0?
arr[10] = {0.0};
double arr[10]= 0.0;
double arr[10] = {0.0};
double arr[] = 0.0;
The string in the array is terminated by a_____
zero
nil
null
one
In C/C++; by default arguments are passed by_____to a function.
Reference
Value
Type
Data
1
char name [] = “Hello World” ; In the above statement, a memory of_______characters will be allocated
13
11
12
10
_______Keyword is used to return some value from a function.
break
return
continue
goto
Which of the function call is call by value for the following function prototype? float add(int);
add(&x);
add(x);
add(int x);
add(*x);
The increment of a pointer depends on its_________.
variable
10
_______Keyword is used to return some value from a function.
break
return
continue
goto
Which of the function call is call by value for the following function prototype? float add(int);
add(&x);
add(x);
add(int x);
add(*x);
The increment of a pointer depends on its_________.
variable
value
data type
None of the given
The ASCHI code of null character is_________
000
010
111
110
data type
None of the given
The ASCHI code of null character is_________
000
010
111
110
Pointers are a special type of __________in which a memory address
is stored
variables
Location
Characters
None of the given
variables
Location
Characters
None of the given
just for copy paste
Transpose of a matrix means that when we interchange rows and
columns_____________
the first row becomes the Last column
the first row becomes the first column
the Last row becomes the first column
the first column becomes the first row
the first row becomes the Last column
the first row becomes the first column
the Last row becomes the first column
the first column becomes the first row
Pointers store the ____________________
value of a variable
memory address
characters
None of the given
Which of the following function call is “call by reference” for
the following function prototype? int add (int *);
add(&x);
add(int x);
add(x);
add(*x);
add(&x);
add(int x);
add(x);
add(*x);
The name of the array is a constant pointer which contains the
memory address of the ____________of the array.
first element
Last element
second element
None of the given
first element
Last element
second element
None of the given
array name always contains the memory address of the ___________of
the array
entire elements
last element
first element
None of the given
entire elements
last element
first element
None of the given
At the___________, we try to break up the problem into functional
units
analysis phase
design phase
Implementation phase
None of the given
analysis phase
design phase
Implementation phase
None of the given
Functions declared
with the _______________ specifier in a class member list are
called friend functions of that class.
protected
private
public
friend
protected
private
public
friend
Functions declared with the friend specifier
in a class member list are called friend functions of that
class. Classes declared with the friend specifier in the member list
of another class are called friend classes of that
class.
Public or private keywords can be ____________
written only for once in the class or structure declaration
written multiple times in the class or structure declaration
written only twice in the class declaration
written outside the class
written only for once in the class or structure declaration
written multiple times in the class or structure declaration
written only twice in the class declaration
written outside the class
good practice is to write public or private keywords
only once in the class or structure declaration, though there is no syntactical
or logical problem in writing them multiple times.
The friend keyword provides access _____________.
in one direction only
in two directions
to all classes
to the data members of the friend class only
in one direction only
in two directions
to all classes
to the data members of the friend class only
The friend keyword
provides access in one direction only. This means that while OtherClass is
a friend of ClassOne, the reverse is not true.
References cannot be uninitialized. Because it is impossible to _______________
References cannot be uninitialized. Because it is impossible to _______________
reinitialize a pointer
reinitialize a reference
initialize a NULL pointer
cast a pointer
http://en.wikipedia.org/wiki/Reference_(C%2B%2B)
References cannot be uninitialized. Because it is impossible to reinitialize a reference,
reinitialize a reference
initialize a NULL pointer
cast a pointer
http://en.wikipedia.org/wiki/Reference_(C%2B%2B)
References cannot be uninitialized. Because it is impossible to reinitialize a reference,
new operator can be used for
______________.
only integer data type
only char and integer data types
integer , float, char and double data types
dot operator
Similarly, new operator can be used for other data types like char, float and double etc.
only integer data type
only char and integer data types
integer , float, char and double data types
dot operator
Similarly, new operator can be used for other data types like char, float and double etc.
The destructor is used to
______________.
allocate memory
deallocate memory
create objects
allocate static memory
deallocate memory
create objects
allocate static memory
Reference is not really an address
it is ______________.
a synonym
an antonym
a value
a number
Difference Between References and Pointers
The reference in a way keeps the address of the data entity. But it is not really an address it is a synonym,
an antonym
a value
a number
Difference Between References and Pointers
The reference in a way keeps the address of the data entity. But it is not really an address it is a synonym,
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]
Memory allocated from heap or free
store _____________________.
can be returned back to the system
automatically
can be allocated to classes only
cannot be returned back unless freed
explicitly using malloc and realloc
cannot be returned
back unless freed explicitly using free and delete operators
The memory allocated from free
store or heap is a system resource and is not
returned back to the system unless explicitly freed usingdelete or free operators.
Operator overloading is to allow the
same operator to be bound to more than one implementation, depending on the
types of the _________.
Compilers
Operands
Function names
Applications
Operands
Function names
Applications
Operator overloading is to allow the
same operator to be bound to more than one implementation, depending on
the types of the operands.
The operator to free the allocated
memory using new operator is ________________.
free
del
delete
remove
del
delete
remove
The operator to free the allocated
memory using new operator is delete. So whenever, we use new to allocate
memory, it will be necessary to make use of ‘delete’ to deallocate the
allocated memory.
1- Memory allocated from heap or
free store _____________________.
Select correct option:
can be returned back to the system
automatically
can be allocated to classes only
cannot be returned back unless freed
explicitly using malloc and realloc
cannot be returned back unless freed
explicitly using free and delete operators
2- Once the _______________ are
created, they exist for the life time of the program
Select correct option:
local variables
non static variables
static variables
automatic variables
Once the static variables are
created, they exist for the life of the program. They do not die. So returning
their reference is all right.3- The members of a class declared with the
keyword struct are _____________by default.
Select correct option:
static
private
protected
public.
The members of a class declared with
the keyword struct are public by default. A structure is inherited
publicly by default.
www. s.info
4- If the memory in the free store
is not sufficient ____________________.
Select correct option:
malloc function returns 1
malloc function returns 0
malloc functions returns NULL
pointer
malloc function returns free space
if the memory in the free store is
not sufficient enough to fulfill the request. malloc() function
returns NULL pointer if the memory is not enough. In
C++, 0 is returned instead ofNULL pointer.
5. This reference to a variable can
be obtained by preceding the identifier of a variable with ________________.
Select correct option:
dot operator
ampersand sign
&
^ sign
·
operator
6- Once an object is declared as a
friend, _________________________.
Select correct option:
it has access to all non-public
members as if they were public
it has access to public members only
it has no access to data members of
the class
it has to protected data members
only
·
Friend declarations introduce extra
coupling between classes
·
Once an object is declared as a friend, it has access to all non-public members as if they were
public
·
Access is unidirectionalIf
B is designated as friend of A, B can access A’s non-public members; A cannot
access B’s
·
A friend function of a class is
defined outsideof that class's scope
7- Reference variables must
_________________.
Select correct option:
not be initialized after they are
declared
be initialized after they are
declared
contain integer value
contain zero value
8- If the request
of new operator is not fulfilled due to insufficient memory in the heap
____________________.
Select correct
option:
the new operator
returns 2
the new operator
returns 1
malloc functions
returns NULL pointer
malloc function
returns free space
9- Reference is not really an
address it is ______________.
Select correct option:
a synonym
an antonym
a value
a number
10- If the request of new operator
is not fulfilled due to insufficient memory in the heap ____________________.
Select correct option:
the new operator returns 2
the new operator returns 1
the operator returns 0
free operator returns nothing
11-
Functions declared with the _______________ specifier in a
class member list are called friend functions of that class.
Select correct option:
protected
private
Select correct option:
protected
private
Public
friend
Functions
declared with the friend specifier in a class member list are called friend
functions of that class. Classes declared with the friend specifier
in the member list of another class are called friend classes of
that class.
12-
public or private keywords can be ____________
Select correct option:
written only for once in the class or structure declaration
written multiple times in the class or structure declaration
written only twice in the class declaration
written outside the class
Select correct option:
written only for once in the class or structure declaration
written multiple times in the class or structure declaration
written only twice in the class declaration
written outside the class
good
practice is to write public or private keywords
only once in the class or structure declaration, though there is no syntactical
or logical problem in writing them multiple times.
13-The
friend keyword provides access _____________.
Select correct option:
in one direction only
in two directions
to all classes
to the data members of the friend class only
Select correct option:
in one direction only
in two directions
to all classes
to the data members of the friend class only
The friend keyword
provides access in one direction only. This means that while OtherClass is
a friend of ClassOne, the reverse is not true.
14-
References cannot be uninitialized. Because it is impossible to _______________
Select correct option:
Select correct option:
reinitialize
a pointer
reinitialize a reference
initialize a NULL pointer
cast a pointer
reinitialize a reference
initialize a NULL pointer
cast a pointer
http://en.wikipedia.org/wiki/Reference_(C%2B%2B)
References
cannot be uninitialized. Because it is impossible to reinitialize a
reference,
15-
new operator can be used for ______________.
Select
correct option:
only
integer data type
only
char and integer data types
integer , float, char and double data types
dot
operator
Similarly,
new operator can be used for other data types like char, float and double etc.
16-
The destructor is used to ______________.
Select
correct option:
allocate
memory
deallocate memory
create
objects
allocate
static memory
16-
If we want to allocate memory to an array of 5 integers dynamically, the syntax
will be _____________.
Select
correct option:
int *iptr ; iptr = new int[5] ;
integer
iptr** ; iptr= new int[5]
int
iptr ; iptr= int [5]
iptr=
new[5]
17-
Memory allocated from heap or free store _____________________.
Select
correct option:
can
be returned back to the system automatically
can
be allocated to classes only
cannot
be returned back unless freed explicitly using malloc and realloc
cannot be returned back unless freed explicitly using free
and delete operators
The
memory allocated from free store or heap is a
system resource and is not returned back to the system unless explicitly freed
using delete or freeoperators.
18-
Operator overloading is to allow the same operator to be bound to more than one
implementation, depending on the types of the _________.
Select
correct option:
Compilers
Operands
Function
names
Applications
Operator
overloading is to allow the same operator to be bound to more than one
implementation,
depending on the types of the operands.
19-
The operator to free the allocated memory using new operator is
________________.
Select
correct option:
free
del
delete
remove
The
operator to free the allocated memory using new operator is delete. So
whenever,
we
use new to allocate memory, it will be necessary to make use of ‘delete’ to
deallocate
the
allocated memory.
20- The concept of friend function
negates the concept of _________________.
Select correct option:
inheritance
polymorphism
persistence
encapsulation
Post a Comment
Don't Forget To Join My FB Group VU Vicky
THANK YOU :)