πŸ’©

programierds

while / interactive simulator

While loop
step by step

Here you see EXACTLY which line runs, what value the variable holds, and what appears on the console.
Press Next or Back and control each iteration yourself.

1) Code being executed Active line: 1
1int i = 1;
2while (i <= 4) {
3  printf("Iteracion %d\n", i);
4  i = i + 1;
5}
6printf("Fin del ciclo\n");
Step 1: Program starts and creates variable i with value 1.
Step 1 / 12
2) Internal state
Value of <code>i</code> 1
Iterations executed 0
Result of <code>i &lt;= 4</code> -
3) Simulated console
./while-demo stdout
← Back to all presentations