NEW
Font size
WorksheetsProgramming C++
Total questions: 10
Worksheet time: 10mins
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. Program do not return a value.
What is the only function all C++ programs must contain?
A.start()
B.system()
C.main()
D.program()
What punctuation is used to signal the beginning and end of code blocks?
A. { }
B. -> and <-
C. BEGIN and END
D. (and)
What punctuation ends most lines of C++ code?
A. .
B. ;
C. :
D. '
Which of the following is a correct comment?
A. */ Comments */
B. ** Comments **
C./* Comments */
D. { Comment }
Which of the following are false about Comments used in C++?
A. Used to documents programs
B. Improve the readability and understanding of programmer
C. Causes action to be performed when the program is executed
D. None of the above
Which of the following is not a correct variable type?
A. float
B. real
C. int
D. double
Which if the following is the correct operator to compare two variables?
A.:=
B: =
C. equal
D.==
The following naming conventions are valid for C++, except:
A. hello123
B. _123hello
C. _
D. 123 hello
The escape sequence \n when output with cost, causes the cursor to position
A. Next blank space on the same line
B. Beginning of the same line on the screen
C. End of the same line on the screen
D. Beginning of the next line on the screen
