One line after another
Control flow is the order in which lines run. With top-level statements, Program.cs runs one statement at a time, from the top down. Line 1 runs first: int n = 3; makes an int variable n that holds 3.
Line 2 starts a while loop. Before every pass it tests a condition, n > 0. In C# a condition must be a bool: true or false. 3 > 0 is true, so the body runs: lines 4 to 8, inside the braces.
Choosing a path
Line 4 asks another question: if (n == 1). Two equals signs mean 'is equal to'. 3 == 1 is false, so line 5 under the if is skipped. The program jumps to the else on line 6.
else means 'otherwise'. Its line runs only when the if's condition was false. Line 7, Console.WriteLine(n), prints the value of n, so 3 appears in the terminal. Exactly one of the two paths runs, never both.
Line 8, n = n - 1;, reads n (3), subtracts 1 and stores the answer back in n. Now n holds 2. Without this line n would stay 3, and the loop would never stop.
Repeating
The closing } on line 9 sends the program back up to line 2 to test again. 2 > 0 is still true, so the body runs once more: 2 == 1 is false, line 7 prints 2, and n becomes 1.
Back at line 2: 1 > 0 is true, so a third pass starts. This time n == 1 is true too, so line 5 runs and prints last. Because the if path ran, the else path on lines 6 and 7 is skipped.
Line 8 makes n 0, and line 9 sends the program back to line 2. Now 0 > 0 is false, so the loop is over: the program jumps past the loop's closing } to line 10.
Line 10 prints Go!. It is the last statement, so the program ends with exit code 0. The output is 3, 2, last, Go!. The loop ran its body three times, and if and else picked one path on each pass.
What happens
;; step 1/9 · sequence Program.cs runs its statements in order, top to bottom the arrow beside the card marks the line running now line 1 int n = 3; → n holds 3 control flow = the order the lines run in if and while change that order (next steps)
In C# a condition must be a bool. There is no conversion from int to bool, so while (n) or if (n) does not compile (error CS0029). Writing if (n = 1) by mistake is also error CS0029, because n = 1 is an int, not a bool. With top-level statements there is no Main method to write. When the last statement finishes, the program ends with exit code 0 (success).