In C, what is the difference between using ++i and i++, and which should be used in the incrementation block of a for loop?
++i
i++
for
i++: In this scenario first the value is assigned and then increment happens.
++i: In this scenario first the increment is done and then value is assigned
Below is the image visualization and also here is a nice practical video which demonstrates the same.