QuestionQ39

Creating and Using Arrays

Consider the following code:

Question Image

What is the output?

  • A 4
  • B 3
  • C 4
  • D 5
  • E 4
  • F 4
Explanation

An array’s length is its element count, which is 4. The element at index 1 is "Venus", and that string contains 5 characters; the output is therefore 4 and then 5 on separate lines.

Community Discussion

No comments yet. Be the first to start the discussion!