Multiple Choice Questions 1
  1. Which of the following is a legal identifier:

  2. 1world
    this_is_legal
    this_isn't_legal
    None of the above are legal identifiers.

  3. White space may occur in any of the following places except

  4. Before and after an operator.
    Within a string constant.
    Between the letters of an identifier.
    Between a function and the left parenthesis.

  5. White space must be used

  6. Before a semicolon.
    Following a unary operator.
    Before and after a binary operator.
    Between a data type name and a variable name in a declaration.

  7. Which of the following is not a keyword:

  8. while
    printf
    int
    All of the above are keywords.

  9. Which of the following is a legal integer constant:

  10. 10.1
    1,000
    1.5e12
    None of the above are integer constants.

  11. What is the value of the expression 6 + 3 * 4?

  12. 18
    36
    54
    The actual value is machine-dependent and may vary from system to system.

  13. What is the value of the expression 16 / 3 % 3 ?

  14. 0
    1
    2
    The expression will generate an error.

  15. What is the value of the expression 5 * (3 + 2) ++ ?

  16. 26
    25
    30
    The expression will generate and error.

  17. Which of the following expression has the value 0 if and only if the value of N is divisible by 20 ?

  18. N / 20
    N % 20
    20 % N
    (N / 20) - (N % 20)

  19. Which of the following is a valid string constant ?

  20. 'I am the string'
    "No, I'm the string"
    "I say, "I am the string", and I am."
    All of the above are valid string constants.

Visited times since 26 Aug 1998.