πŸ’©

programierds

for / guided simulation

For loop step by step

Here you understand perfectly the rhythm of the for: initialization, condition, block, and update. Everything in order, no magic.

1) Code and active line Active line: 1
1for (int i = 1; i <= 4; i++) {
2  printf("Paso %d\n", i);
3}
4printf("Fin for\n");
Step 1: Initializes i = 1.
Paso 1 / 12
2) Internal state
i actual1
Iteraciones ejecutadas0
Condicion i <= 4-
Fase actualinit
3) Simulated console
./for-demostdout