Welcome to the Ranch, Syd
Always use
%n after
printf, rather than
\n.
You start your for loop with
i = 5,
j = 3, and as you correctly say, the do loop runs twice, leaving
j = 1. Then
i is reduced by 3, to 2.
Then your for loop runs a second time, and you start your do loop. A do loop always runs once, then it tests for its continuation condition. The do loop therefore runs a 3rd time . . .
Then,
j = 0, and
i is reduced again by 3 to -1, so
i >
j returns
false and the for loop terminates.