Limited access

Upgrade to access all content for this subject

Consider the following code segment.

int x = 2;
int[] y = {5,7,5};
double[] z = {10,2,10};
System.out.println(y[x]/z[x] + y[x-1]/z[x-1] + x);

What is printed as a result of executing the code segment?

A

4.0

B

4.5

C

5.0

D

5.5

E

6.0

Select an assignment template