1 ) How many values can be returned from a function ? A ) one , B ) three , C ) four ,

1 )  How many values can be returned from a function ?

A )  one ,

B )  three ,

C )  four ,

Correct answers : -   A )  one ,

 

2 )  A relational operator  ……………….. ,

A )  assigns one operand to another ,

B )  yields a Boolean result and compares two operands .

C )  compares two operators ,

D )  logically combines two operands ,

Correct answers : -   B )  yields a Boolean result and compares two operands .

 

3 )  A variable defined within a block is visible ………… ,

A )   from the point of definition onward in the program .

B )   from the point of definition onward in the function .

C )   from the point of definition onward in the block .

D )   throughout the function .

Correct answers : -   C )   from the point of definition onward in the block .

 

4 )  The && and || operators ………………. ,

A )  compare two numeric values .

B )  combine two numeric values .

C )  compare two Boolean values .

D )  combine two Boolean values .

Correct answers : -    D )  combine two Boolean values .

 

5 )  The break statement causes an exit …………….. ,

A )  only from the innermost loop .

B )  only from the innermost switch .

C )  from all loops and switches .

D )  from the innermost loop or switch .

Correct answers : -   D )  from the innermost loop or switch .

 

6 )  The goto statement causes control to go to …………… ,

A )  an operator .

B )  a label .

C )  a variable .

D )  a function .

Correct answers: B )  a label .

 

7 )  A function’s single most important role is to ……………….. ,

A )   give a name to a block of code .

B )   reduce program size and help organize a program into conceptual units .

C )  accept arguments and provide a return value .

D )  perform repetition .

Correct answers : -    B )   reduce program size and help organize a program into conceptual units .

 

8 )  When an argument is passed by reference ……………. ,

A )  a variable is created in the function to hold the argument’s value .

B )  the function cannot access the argument’s value .

C )  a temporary variable is created in the calling program to hold the argument’s value .

D )  the function accesses the argument’s original value in the calling program .

Correct answers : -  D )  the function accesses the argument’s original value in the calling program .

 

9 )  In a class definition, data or functions designated private are accessible ………….. ,

A )  to any function in the program .

B )  only if you know the password .

C )  to member functions of that class .

D )  only to public members of the class .

Correct answers : -    C )  to member functions of that class .

 

10 )  Data items in a class must be private .

A )  True ,

B )  False ,

Correct answers : -   B )  False ,

 

Post a Comment

0 Comments