Answer:
ii and iii only
Step-by-step explanation:
=> Analysis of the first code snippet;
int i = 1;
while(i < a.length)
{
System.out.println(a[i]);
i++;
}
The code initializes the variable i to 1 and then loops from i=1 to one less than the length of the array a. At each of the loop, the corresponding element of the array at the index specified by the variable i is printed. And since i is starting at 1, the first element of the array (the one at index 0) will not be printed. Other elements in the array will be printed.
=> Analysis of the second code snippet;
int i;
for (i = 0; i < a.length; i++)
{
System.out.println(a[i]);
}
The code initializes the variable i to 0 and then loops from i=0 to one less than the length of the array a. At each of the loop, the corresponding element of the array at the index specified by the variable i is printed. And since i is starting at 0, the first element of the array (the one at index 0) will be printed. Other elements in the array will also be printed. In other words, all of the elements in the array will be printed.
=> Analysis of the third code snippet;
for (int i : a)
{
System.out.println(i);
}
The code uses the enhanced for version to print all the elements in the given array a. In the code each element in the array a is represented by i at various loop cycles. Therefore all the elements in the array a will be printed.
In summary, ii and iii will produce the same results.