I was writing this C program and found out this confusion. what if we use multiple operations on a single variable on a single line. For example,
int arr[5], i = 0;
while(i < 5){
arr[i] = ++i;
}
and then we print all the elements of the array. here first the increment happens and the the assignment. therefore the elements would be 1, 2, 3, 4, 5. But when I print them, they start out from 0 and then increase upto 4. Can anyone explain what is the logic that is followed here. like why do we get those numbers as an output?