How would I write the following for loop using an enhanced for loop>
int [] info = {1,2,3,4,5,6,7,8,9,10};
int i;
for (i = 0; i < info.length; i++) {
if ((i+1) % 10 == 0)
System.out.println(info[i]);
else
System.out.println(info[i] + ", ");
}
I am trying the following, but i guess im doing it incorreclty
for(int i: info){
body here///