Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

need helpwith question 11. What happens when an array declaration statement does

ID: 3715123 • Letter: N

Question

need helpwith question 11.

What happens when an array declaration statement does not provide an initial value for each of the elements in a numeric array? 1. The compiler automatically initialises the elements, so the array elements contain 0. 2. The compiler does not automatically initialise the elements, but as it is a numeric array, all array elements cont numeric value. 3. The compiler does not automatically initialise the elements, so the array elements 4. The compiler automatically initialises the elements with 0 may contain garbage. Question 10 Given the array declaration below, what is stored in numbers[2]? int numbers [5] (1, 2, 3, 4, 5 1. ? 2. 1 3. 2 4) 3 Question 11 Given the array declaration below, which assignment statement will place t he number 5 into the fifth array element? int numbers [5] 0 1. numbers 4]5; 2. numbers [5) 5; 3. numbers [1+3]-5 4. numbers [1+4 5; 6 30 innction was introduced i r solution Test yourself ) need an array of 15 places and

Explanation / Answer

The option is A because

we are declaring an aray like this

public static void main(String args[])

{

int numbers[]={11,12,13,4,5}

System.out.Println("teh value is "+numbers[4]);

o/p The value should be printed is a[4]=5;

hence the option is A

numbers[4]=5;