Placement papers on C++ - Set 2

Placement papers on C++ - Set 2


1. Regarding following statement which of the statements is true?

const int pathwidth=100;

Declares a variable pathwidth with 100 as its initial value
Declares a construction pathwidth with 100 as its initial value
Declares a constant pathwidth whose value will be 100
Constructs an integer type variable with pathwidth as identifier and 100 as value
View Answer / Hide Answer

ANSWER: Declares a constant pathwidth whose value will be 100




2. A function can not be overloaded only by its return type.

TRUE
FALSE
View Answer / Hide Answer

ANSWER: TRUE




3. A function can be overloaded with a different return type if it has all the parameters same.

TRUE
FALSE
View Answer / Hide Answer

ANSWER: FALSE




4. A function that calls itself for its processing is known as

Inline Function
Nested Function
Overloaded Function
Recursive Function
View Answer / Hide Answer

ANSWER: Recursive Function




5. Observe following function declaration and choose the best answer:

int divide ( int a, int b = 2 )

Variable b is of integer type and will always have value 2
Variable a and b are of int type and the initial value of both variables is 2
Variable b is international scope and will have value 2
Variable b will have value 2 if not specified when calling function
View Answer / Hide Answer

ANSWER: Variable b will have value 2 if not specified when calling function




6. Variables inside parenthesis of functions declarations have _____ level access.

Local
Global
Module
Universal
View Answer / Hide Answer

ANSWER: Local




7. Strings are character arrays. The last index of it contains the null-terminated character

\n
\t
\0
\1
View Answer / Hide Answer

ANSWER: \0




8. Which of the following identifiers is invalid?

papername
writername
typename
printname
View Answer / Hide Answer

ANSWER: typename




9. Regarding following statement which of the statements is true?

const int pathwidth=100;

Declares a variable pathwidth with 100 as its initial value
Declares a construction pathwidth with 100 as its initial value
Declares a constant pathwidth whose value will be 100
Constructs an integer type variable with pathwidth as identifier and 100 as value
View Answer / Hide Answer

ANSWER: Declares a constant pathwidth whose value will be 100




10. In an assignment statement

The lvalue must always be a variable
The rvalue might be a constant, a variable, an expression or any combination of these
The assignment always takes place from right to left and never the other way
All of above
View Answer / Hide Answer

ANSWER: All of above


Post your comment

You may like