Following are the multiple choice questions from C++. Please scroll down to check the answers.
A variable is/are
a. String that varies during program execution
b. A portion of memory to store a determined value
c. Those numbers that are frequently required in programs
d. None of these
Which of the following can not be used as identifiers?
Which of the following identifiers is invalid?
Which of the following can not be used as valid identifier?
The difference between x and ‘x’ is
a. The first one refers to a variable whose identifier is x and the second one refers to the character constant x
b. The first one is a character constant x and second one is the string literal x
c. Both are same
d. None of above
Which of the following is not a valid escape code?
Which of the following statement is true?
a. String Literals can extend to more than a single line of code by putting a backslash sign at the end of each unfinished line.
b. You can also concatenate several string constants separating them by one or several blank spaces, tabulators, newline or any other valid blank character
c. If we want the string literal to explicitly made of wide characters, we can precede the constant with the L prefix
d. All of above
Regarding #difine which of the following statement is false?
a. It is not C++ statement but the directive for the preprocessor
b. This does not require a semicolon at the end of line
c. It is a C++ statement that declares a constant in C++
d. None of the above
Regarding following statement which of the statements is true?
const int pathwidth=100;
a. Declares a variable pathwidth with 100 as its initial value
b. Declares a construction pathwidth with 100 as its initial value
c. Declares a constant pathwidth whose value will be 100
d. Constructs an integer type variable with pathwidth as identifier and 100 as value
In an assignment statement
a. The lvalue must always be a variable
b. The rvalue might be a constant, a variable, an expression or any combination of these
c. The assignment always takes place from right to left and never the other way
d. All of above
1. b. A portion of memory to store a determined value
2. d. Spaces
3. c. Typename
4. a. Bitand
5. a. The first one refers to a variable whose identifier is x and the second one refers to the character constant x
6. d. \w
7. d. All of above
8. c. It is a C++ statement that declares a constant in C++
9. c. Declares a constant pathwidth whose value will be 100
10. d. All of above
|< Prev||Next >|