Engineering C++ - Test
  • 1. What is the correct value to return to the operating system upon the successful completion of a program?
A) 0
B) 1
C) Programs do not return a value.
D) -1
  • 2. What is the only function all C++ programs must contain?
A) main()
B) system()
C) program()
D) start()
  • 3. What punctuation is used to signal the beginning and end of code blocks?
A) { }
B) -> and <-
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) ** Comment **
B) */ Comments */
C) /* Comment */
D) { Comment }
  • 6. Which of the following is not a correct variable type?
A) int
B) real
C) double
D) float
  • 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) Source Code
C) Programs do not return a value
D) A variable that ends with a semicolon
  • 9. What is PC-Lint?
A) An IDE
B) A Static Analysis Tool for C/C++
C) An Source Code Tool
D) A C/C++ Compiler
  • 10. An If-Statement is based off if a given condition is what?
A) Equal Equal
B) True or False
C) Boolean
D) Equal
  • 11. Which is not an relational operator?
A) ==
B) @
C) >=
D) <=
  • 12. Which statement is False?
A) 5 == 6
B) 4 >= 4
C) 5 != 4
D) 3 <= 4
  • 13. Which is not a type of Loop?
A) Do-While
B) If-Else
C) For
D) While
  • 14. PC-Lint is for what language?
A) .Net
B) Java
C) C#
D) C++
  • 15. A Do While loop is useful for…
A) to loop once
B) reversed
C) 1 choice
D) multiple choices
  • 16. What is the result of the following statement?
    X = 10;
    Y = ++x;
A) x = 10, y = 10
B) x = 10, y = 11
C) x = 11, y = 11
D) x = 11, y = 10
  • 17. What is the result of the following statement?
    X = y = z = 0;
A) x = 0, y = 0, z = 0
B) The statement is incorrect
C) x = 0, y = Null, z = Null
D) x = 0, y = 1, z = 2
  • 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) 11, 16
B) 11, 15
C) 10, 16
D) 10,15
  • 19. What is the only function all C++ programs must contain?
A) main()
B) system()
C) program()
D) start()
  • 20. What punctuation ends most lines of C++ code?
A) ‘(single quote)
B) ;(semi-colon)
C) .(dot)
D) :(colon)
Created with That Quiz — where a math practice test is always one click away.