In the following piece of code:
#include <stdio.h>
#include <stddef.h>
void main ()
{
int n[5] = {1,2,3,4,5};
printf("%s%13s\n","element","value");
for (size_t i = 0; i<5; ++i)
{
printf("%7d%13u\n", i, n[i]);
}
}
the output is:
element value
0 1
1 2
2 3
3 4
4 5
What I don't understand is how i
which is pre-incremented, gives off the values from 0 to 4.
I believe it should be 1 to 4, since it would not pass the condition.
What's the reasoning behind this?