CPA-21-02

CPA-21-02 practice questions, page 2 of 2, with answer review and explanations.

Question 6

The following declaration: int i = 0b10;

  1. is invalid
  2. sets variable i with an integer value equal to 10
  3. sets variable i with an integer value equal to 2 (10 binary)
  4. sets variable i with an integer value equal to 8 (10 octal)

Question 7

The following declaration: int i = 010;

  1. sets variable i with an integer value equal to 10
  2. sets variable i with an integer value equal to 2 (10 binary)
  3. is invalid
  4. sets variable i with an integer value equal to 8 (10 octal)

Question 8

Which of the following operators accept integer arguments only? (Choose two.)

  1. |
  2. | |
  3. ~
  4. !