Programming Languages (C++)

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.

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

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

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

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. float
B. real
C. int
D. double

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

8. Which of the following is true?
A. 1
B. 66
C. .1
D. -1
E. All of the above

9. Which of the following is the boolean operator for logical-and?
A. &
B. &&
C. |
D. |&

10. Evaluate !(1 && !(0 || 1)).
A. True
B. False
C. Unevaluatable


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

Comments

Popular posts from this blog

Electrical Machines (D.C. Generators)

Material Science Quiz (Mechanical Properties of Metals)

Material Science Quiz (Failure)