How Loops Work
A loop repeats the same code multiple times. In a for loop, a loop variable i starts at 0 and increases by 1 each time, repeating the code as long as the condition holds. In this example, each pass assigns i × i to element arr[i] in the array arr, filling it in one step at a time.
After this loop processes i up to 2, what's the value of element arr[2] in the array arr?