Question 1.

What is the correct value to return to the operating system upon the successful completion of a program? A. -1 B. 1 C. 0 D. Programs do not return a value.

Question 2.
What is the only function all C++ programs must contain? A. start() B. system() C. main() D. program()

Question 3.
What punctuation is used to signal the beginning and end of code blocks? A. { } B. -> and <C. BEGIN and END D. ( and )

Question 4.
What punctuation ends most lines of C++ code? A. . (dot) B. ; (semi-colon) C. : (colon) D. ' (single quote)

Question 5.
Which of the following is a correct comment? A. */ Comments */ B. ** Comment ** C. /* Comment */ D. { Comment }

Question 6.

Evaluate !(1 && !(0 || 1)). |& Question 10. False C. float B. Unevaluatable Answers . real C.Which of the following is not a correct variable type? A. equal D.1 D. Which of the following is true? A. Which of the following is the boolean operator for logical-and? A. All of the above Question 9. && C. == Question 8. 66 C. . double Question 7. & B. := B. int D. A. | D. = C. -1 E. Which of the following is the correct operator to compare two variables? A. 1 B. True B.

&& 10. Programmer can use comments to include short explanations within the source code itself. both Question 2 The directives for the preprocessors begin with a.1. Both of these None of these . All of the above 9. Comments very important effect on the behaviour of the program d. D. C. real 7. The declarations of the basic standard input-output library. B. A. c. 0 2. d. A. B. All lines beginning with two slash signs are considered comments. 5. d. b. True Question 1 Identify the correct statement a. /* Comment */ 6. b. B. c. The streams of includes and outputs of program effect. Ampersand symbol (& Two Slashes (//) Number Sign (#) Less than symbol (< Question 3 The file iostream includes a. == 8. main() 3. C. E. b. . { } 4. c. C.

c.Question 4 There is a unique function in C++ program by where all C++ programs start their execution a. c. d. Parameters Parenthesis Curly braces None of these Question 6 Which of the following is false? a. d.) A Semicolon ( A colon ( .) A Comma (. Start() Begin() Main() Output() Question 5 Every function in C++ are followed by a. c. Cout represents the standard output stream in c++. b. A full stop (. c. d. Cout is declared in the iostream standard file Cout is declared within the std namespace None of above Question 7 Every statement in C++ program should end with a. b. b. d. b.

d. The declarations of the basic standard input-output library. b. Use code and /* comment on the same line Use code and // comments on the same line Use code and //* comments on the same line Use code and <!. Starting every line with double slashes (//) Starting with /* and ending with */ Starting with //* and ending with *// Starting with <!. 6. b. These are lines read and processed by the preprocessor They do not produce any code by themselves These must be written on their own line They end with a semicolon Question 9 A block comment can be written by a. 2. d. Number Sign (#) a. Parenthesis d. c. All lines beginning with two slash signs are considered comments. 5. d. 4. c. 3. b. None of above .and ending with -!> Question 10 When writing comments you can a. c. Main() b. b. c.Question 8 Which of the following statement is true about preprocessor directives? a.comments on the same line answers 1. c.

None of these Question 2 Which of the following can not be used as identifiers? a. 10.7. 9. String that varies during program execution b. Underscores . Letters b. Use code and // comments on the same line Question 1 A variable is/are a. A portion of memory to store a determined value c. c. A semicolon d. Starting with /* and ending with */ b. Digits c. 8. Those numbers that are frequently required in programs d. They end with a semicolon b.

d. typename d. bitand b. band . biand d. Spaces Question 3 Which of the following identifiers is invalid? a. papername b. bittand c. printname Question 4 Which of the following can not be used as valid identifier? a. writername c.

The first one refers to a variable whose identifier is x and the second one refers to the character constant x b. \v c. Both are same d. None of above Question 6 Which of the following is not a valid escape code? a. \t b. The first one is a character constant x and second one is the string literal x c. \w . \f d.Question 5 The difference between x and ‘x’ is a.

we can precede the constant with the L prefix d. newline or any other valid blank character c. If we want the string literal to explicitly made of wide characters. 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 .Question 7 Which of the following statement is true? a. You can also concatenate several string constants separating them by one or several blank spaces. b. tabulators. It is not C++ statement but the directive for the preprocessor b. All of above Question 8 Regarding #difine which of the following statement is false? 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.

The assignment always takes place from right to left and never the other way . an expression or any combination of these c. The lvalue must always be a variable b. Declares a variable pathwidth with 100 as its initial value b. Declares a constant pathwidth whose value will be 100 d. The rvalue might be a constant. Constructs an integer type variable with pathwidth as identifier and 100 as value Question 10 In an assignment statement a. a.Question 9 Regarding following statement which of the statements is true? const int pathwidth=100. Declares a construction pathwidth with 100 as its initial value c. a variable.

1. b. Spaces 3. d. d. All of above . The first one refers to a variable whose identifier is x and the second one refers to the character constant x 6. Declares a constant pathwidth whose value will be 100 10. It is a C++ statement that declares a constant in C++ 9. A portion of memory to store a determined value 2. \w 7. Typename 4. c. Bitand 5. d. a. d. c. a. All of above 8. c.

Sign up to vote on this title
UsefulNot useful