41. | Which of the following operators cannot be overloaded in C/C++? |
a. | Bitwise right shift assignment |
b. | Address of |
c. | Indirection |
d. | Structure reference |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (d).Structure reference
|
42. | Given i= 0, j = 1, k = – 1, x = 0.5, y = 0.0
What is the output of given ‘C’ expression ? x * 3 & & 3 || j | k |
a. | -1 |
b. | 0 |
c. | 1 |
d. | 2 |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (c).1
|
43. | The following ‘C’ statement :
int * f[ ]( ); declares : |
a. | A function returning a pointer to an array of integers |
b. | Array of functions returning pointers to integers |
c. | A function returning an array of pointers to integers |
d. | An illegal statement |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (b).Array of functions returning pointers to integers
|
44. | If a function is friend of a class, which one of the following is wrong ? |
a. | A function can only be declared a friend by a class itself. |
b. | Friend functions are not members of a class, they are associated with it. |
c. | Friend functions are members of a class. |
d. | It can have access to all members of the class, even private ones. |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (c).Friend functions are members of a class.
|
45. | In C++, polymorphism requires: |
a. | Inheritance only |
b. | Virtual functions only |
c. | References only |
d. | Inheritance, Virtual functions and references |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (d).Inheritance, Virtual functions and references
|
46. | A function template in C++ provides ............ level of generalization. |
a. | 4 |
b. | 3 |
c. | 2 |
d. | 1 |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (c).2
|
47. | Assume that the program ‘P’ is implementing parameter passing with ‘call by reference’. What will be printed by following print statements in P?
Program P() { x = 10; y = 3; funb (y, x, x) print x; print y; } funb (x, y, z) { y = y + 4; z = x + y + z; } |
a. | 10, 7 |
b. | 31, 3 |
c. | 10, 3 |
d. | 31, 7 |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (b).31, 3
|
48. | Consider the following program:
#include< stdio.h > main() { int i, inp; float x, term=1, sum=0; scanf(“%d %f”,&inp, &x); for(i=1;i<=inp;i++) { term=term*x/i; sum=sum+term; } printf(“Result=%f\n”,sum); } The program computes the sum of which of the following series? |
a. | x+x^2/2+x^3/3+x^4/4+... |
b. | x+x^2/2!+x^3/3!+x^4/4!+... |
c. | 1+x^2/2+x^3/3+x^4/4+... |
d. | 1+x^2/2!+x^3/3!+x^4/4!+... |
View Answer Report Discuss Too Difficult! |
Answer: (b).x+x^2/2!+x^3/3!+x^4/4!+...
|
49. | In C++, which system-provided function is called when no handler is provided to deal with an exception? |
a. | terminate() |
b. | unexpected() |
c. | abort() |
d. | kill() |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (a).terminate()
|
50. | Match the following:
List-I List-II a. Automatic Storage Class i. Scope of the variable is global. b. Register Storage Class ii. Value of the variable persists between different function calls. c. Static Storage Class iii. Value stored in memory and local to the block in which the variable is defined. d. External Storage Class iv. Value stored in CPU registers. Codes: a b c d |
a. | iii iv i ii |
b. | iii iv ii i |
c. | iv iii ii i |
d. | iv iii i ii |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (b).iii iv ii i
|