CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

While Loop Countdown

C++ code walkthrough · Question 12
easyLoops

Code

Read carefully. What does this print?
1#include <iostream>
2using namespace std;
3 
4int main() {
5 int n = 4;
6 while (n > 0) {
7 cout << n << " ";
8 n--;
9 }
10 cout << "Go!" << endl;
11 return 0;
12}

Your answer