Programming Languages (C/C++)

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

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

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

4. What punctuation must be used to end lines of C++ code?
A. . (dot)
B. ‘ (single quote)
C. ; (semi-colon)
D. : (colon)

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

6. Which of the following is not a correct variable type?
A. double
B. float
C. int
D. real

7. Which of the following is the correct operator to compare two variables?
A. =
B. ==
C. :=
D. equal

8. Which of the following is the Boolean operator for logical and?
A. &
B. &&
C. |&
D. ||

9. The directives for the preprocessors begin with
A. Ampersand symbol (&)
B. Less than symbol (<)
C. Two Slashes (//)
D. Number Sign (#)

10. The file “iostream” includes
A. The streams of includes and outputs of program effect.
B. The declarations of the basic standard input-output library.
C. Both of these
D. None of these

Answers
1 – A / 2 – D / 3 – C / 4 – C / 5 – B / 6 – D / 7 – B / 8 – B / 9 – D / 10 – B

Comments

Popular posts from this blog

Electrical Machines (D.C. Generators)

Material Science Quiz (Mechanical Properties of Metals)

Material Science Quiz (Failure)