Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
* Iteration 1: `x = 0`, even → `x += 3` → `x = 3` * Iteration 2: `x = 3`, odd → `x++` → `x = 4` * Iteration 3: `x = 4`, even → `x += 3` → `x = 7` Loop ends when `x = 7`, so output is `7`.