ThatQuiz Test Library Take this test now
Mathematics C++ - Test
Contributed by: Brown
  • 1. What is the correct value to return to the operating system upon the successful completion of a program?
A) 0
B) Programs do not return a value.
C) 1
D) -1
  • 2. What is the only function all C++ programs must contain?
A) program()
B) system()
C) start()
D) main()
  • 3. What punctuation is used to signal the beginning and end of code blocks?
A) ( and )
B) { }
C) -> and <-
D) BEGIN and END
  • 4. What punctuation ends most lines of C++ code?
A) :
B) .
C) ;
D) '
  • 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) int
C) real
D) double
  • 7. Which of the following is the correct operator to compare two variables?
A) :=
B) ==
C) equal
D) =
  • 8. What is an undeclared variable?
A) A variable that you didn’t declare
B) Programs do not return a value
C) Source Code
D) A variable that ends with a semicolon
  • 9. What is PC-Lint?
A) A Static Analysis Tool for C/C++
B) An IDE
C) A C/C++ Compiler
D) An Source Code Tool
  • 10. An If-Statement is based off if a given condition is what?
A) True or False
B) Boolean
C) Equal Equal
D) Equal
  • 11. Which is not an relational operator?
A) <=
B) @
C) >=
D) ==
  • 12. Which statement is False?
A) 3 <= 4
B) 4 >= 4
C) 5 != 4
D) 5 == 6
  • 13. Which is not a type of Loop?
A) Do-While
B) If-Else
C) While
D) For
  • 14. PC-Lint is for what language?
A) C++
B) .Net
C) Java
D) C#
  • 15. A Do While loop is useful for…
A) reversed
B) multiple choices
C) 1 choice
D) to loop once
  • 16. What is the result of the following statement?
    X = 10;
    Y = ++x;
A) x = 10, y = 10
B) x = 11, y = 11
C) x = 10, y = 11
D) x = 11, y = 10
  • 17. What is the result of the following statement?
    X = y = z = 0;
A) The statement is incorrect
B) x = 0, y = 0, z = 0
C) x = 0, y = 1, z = 2
D) x = 0, y = Null, z = Null
  • 18. What will the output of the following code?
    {
    int x = 10, y = 15;
    x = x++;
    y = ++y;
    printf(“%d,%d\n”, x,y);
    {hj
A) 10,15
B) 10, 16
C) 11, 16
D) 11, 15
  • 19. What is the only function all C++ programs must contain?
A) program()
B) system()
C) start()
D) main()
  • 20. What punctuation ends most lines of C++ code?
A) .(dot)
B) ;(semi-colon)
C) ‘(single quote)
D) :(colon)
Created with That Quiz — the site for test creation and grading in math and other subjects.