Computer Applications

The following statement :
int code[ ]= {25,37,38,42};

  1. assigns 37 to code[1]
  2. assigns 25 to code[1]
  3. assigns 38 to code[3]
  4. assigns 42 to code[0]

Java Arrays

56 Likes

Answer

assigns 37 to code[1]

Reason — The statement int code[ ]= {25,37,38,42}; assigns 37 to code[1] as the array index begins from 0. So the second value (37) will be assigned to code[1].

Answered By

23 Likes


Related Questions