The following code is simple, What I want to know is the execution time for ++counter. I know for a for loop, count<5 is the first condition to check,but then for the execution time of ++counter I'm not so sure. line 1, 2 or 3, which is the place to execute increment?
#include <stdio.h>
int main()
{
int counter;
/* counter for loop */
for (counter = 0; counter < 5; ++counter) { // 1
printf("x %d\n", counter+1); // 2
} //3
return (0);
}
And the result is
x 1
x 2
x 3
x 4
x 5