+ 2
Okay, i in the for loop isn't a representation of the array's elements, but the array's indexes. Indexes start from 0, not from 1, so you'll first be multiplying by 0
26th Jun 2019, 4:30 AM
Airree
Airree - avatar
+ 2
This isn't an enhanced for loop, so if you look at it closely, you don't multiply by arr[i], but by i, which is 0, 1, 2, 3.
26th Jun 2019, 4:21 AM
Airree
Airree - avatar