Slow down. See the logic.
Code tracing studio
Follow curated C examples one step at a time and see how variables, call frames and output change.
Educational model traces for these exact examples — not a C interpreter or live execution. Arbitrary source can be reviewed in the free-entry static debugger, but is not executed here.
Accumulator loop
Trace a for loop that adds 1 through 4.
sum.cC
1#include <stdio.h>2int main(void) {3 int sum = 0;4 for (int i = 1; i <= 4; ++i) {5 sum += i;6 }7 printf("%d\n", sum);8 return 0;9}Step 1 of 12
CURRENT LINE 3
Initialize the accumulator.
Variable watch
| Variable / frame | Current value |
|---|---|
| sum | 0 |
Output so far
No output yet.