C++ Multiple Choice
C++ Multiple Choice
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.
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.
Question 5.
Question 6.
Which of the following is not a correct variable type?
A. float
B. real
C. int
D. double
Question 7.
Question 8.
Question 9.
Question 10.
Answers
1. C. 0
2. C. main()
3. A. { }
4. B. ;
5. C. /* Comment */
6. B. real
7. D. ==
8. E. All of the above
9. B. &&
10. A. True
Question 1
a. Programmer can use comments to include short explanations within the source code
itself.
b. All lines beginning with two slash signs are considered comments.
d. both
Question 2
Question 3
c. Both of these
d. None of these
Question 4
There is a unique function in C++ program by where all C++ programs start their execution
a. Start()
b. Begin()
c. Main()
d. Output()
Question 5
a. Parameters
b. Parenthesis
c. Curly braces
d. None of these
Question 6
d. None of above
Question 7
b. A Comma (,)
c. A Semicolon (
d. A colon (
Question 8
Question 9
Question 10
answers
1. b. All lines beginning with two slash signs are considered comments.
4. c. Main()
5. b. Parenthesis
6. d. None of above
7. c. A semicolon
Question 1
A variable is/are
d. None of these
Question 2
a. Letters
b. Digits
c. Underscores
d. Spaces
Question 3
a. papername
b. writername
c. typename
d. printname
Question 4
a. bitand
b. bittand
c. biand
d. band
Question 5
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
d. None of above
Question 6
a. \t
b. \v
c. \f
d. \w
Question 7
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
Question 8
d. Constructs an integer type variable with pathwidth as identifier and 100 as value
Question 10
In an assignment statement
c. The assignment always takes place from right to left and never the other way
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