Multiple choice questions:
a) Which data type is used to represent the absence of parameters?
i) int ii) short
iii) void iv) float
b) Which of the following statements are true? [Int f (float)]
i) f is a function taking an argument of type int and returning a floating point
number
ii) f is a function taking an argument of type float and returning an integer
iii) f is a function of type float
iv) None of the mentioned
c) When a language has the capability to produce new data types mean, it can be
called as
i) overloaded ii) extensible
iii) encapsulated iv) reprehensible
d) Function overloading is also similar to which of the following?
i) operator overloading ii) constructor overloading
iii) destructor overloading iv) none of the mentioned
e) What will happen while using pass by reference
i) The values of those variables are passed to the function so that it can
manipulate them
ii) The location of variable in memory is passed to the function so that it can use
the same memory area for its processing
iii) The function declaration should contain ampersand (and in its type declaration)
iv) All of the mentioned
f) Which keyword is used to handle the exception?
i) try ii) throw
iii) catch iv) None of the mentioned
g) Pick out the correct statement.
i) A derived class's constructor cannot explicitly invokes its base class's constructor
ii) A derived class's destructor cannot invoke its base class's destructor
iii) A derived class's destructor can invoke its base class's destructor
iv) None of the mentioned
h) How does the string are stored in the memory?
i) Contiguous ii) Non-contiguous
iii) Null iv) All of the mentioned
i) What does derived class does not inherit from the base class?
i) Constructor and destructor ii) friends
iii) operator = () members iv) All of the mentioned
j) Which operator is having the highest precedence?
i) postfix ii) unary
iii) shift iv) equality
Answers
Answer:
a) 1.
b) 4.
c) 1.
d) 1.
e) 3.
f) 1,3
g) 4.
h) 1.
i) 3.
j) 3.
Answer:
The correct answers are as follows:
a) option(iii)
b) option (ii)
c) option (i)
d) option (ii)
e) option (iv)
f) option (iii)
g) option (iv)
h) option (i)
i) option (iii)
j) option (ii)
Explanation:
a) Void data type is used to represent the absence of parameters.
b) Int f (float) can be defined as f is a function taking an argument of type float and returning an integer.
c) When a language has the capability to produce new data types mean, it can be called as overloaded
d) Function overloading is also similar to constructor overloading.
e) while using pass by reference following things happen:
- The values of those variables are passed to the function so that it can
- manipulate them
- The location of the variable in memory is passed to the function so that it can use the same memory area for its processing
- The function declaration should contain an ampersand (and in its type declaration)
f) catch keyword is used to handle the exception.
g) None of the mentioned statements is correct.
h) The string are stored in the Contiguous memory.
i) Derived class does not inherit operator = () members from the base class.
j) postfix operator is having the highest precedence
#SPJ3