Hi Shaily !!!
1) For the first point:
Let us have int arr[] = {1,2,3,4};
When we enter the loop:
i = 1 --> arr[1] = 0; Now arr[] = {1,0,3,4}
i = 0 --> arr[0] = 0; Now arr[] = {0,0,3,4}
i = 3 --> arr[3] = 0; Now arr[] = {0,0,3,0}
i = 0 --> arr[0] = 0; Now arr[] = {0,0,3,0}
At the end of the loop We have arr is {0,0,3,0}
2) For the second point:
If i != 2 ret is not initialized and the compiler will complain because you are trying to return
ant integer that does not exist.