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

Do-While Loop Behavior

C++ code walkthrough · Question 9
easyLoops

Code

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

Your answer