PCAP Practice Test

PCAP Practice Test practice questions, page 6 of 6, with answer review and explanations.

Question 26

What is the expected output of the following code?

  1. abcef
  2. The program will cause a runtime exception/error
  3. acdef
  4. abdef

Question 27

What is the expected output of the following code?

  1. 21
  2. 2
  3. 3
  4. 12

Question 28

What is the expected behavior of the following snippet? It will:

  1. cause a runtime exception on line 02
  2. cause a runtime exception on line 01
  3. cause a runtime exception on line 03
  4. print 3