Question: What does the following code fragment print? int[] a = new int[10]; for (int i = 0; i < 10; i++) a[i] = 9 -
What does the following code fragment print?
int[] a = new int[10];
for (int i = 0; i < 10; i++)
a[i] = 9 - i;
for (int i = 0; i < 10; i++)
a[i] = a[a[i]];
for (int i = 0; i < 10; i++)
System.out.println(a[i]);
Step by Step Solution
3.33 Rating (165 Votes )
There are 3 Steps involved in it
The code you posted creates an array of integers named a of size 10 fills it with numbers from 9 to ... View full answer
Get step-by-step solutions from verified subject matter experts
