The for loop runs four iterations, so count gets incremented by one four times. count goes from 0 to 1 to 2 to 3 to 4, then is displayed. The while condition is still true, so the for loop executes again: 5,6,7,8, display.
While condition still true, so for loop goes again: 9, 10, 11, 12, display.
Now the while condition is false and the outer loop ends.