Limited access

Upgrade to access all content for this subject

Consider the following code segment.

int age[] = {20, 10, 80, 50};
for (int i=age.length-1; i>=0; i--)
{
    for (int j=0; j<age.length; j++)
    {
        int temp = age [i];
        age[i]=age[j]-2;
        age[j]=temp+2;
    }
}
for (int i=0; i<age.length; i++)
    System.out.print(age[i] +  " ");

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

A

80 50 20 10

B

20 10 80 50

C

76 58 20 14

D

22 12 82 52

E

72 48 12 4

Select an assignment template