CJCoding With Joseph
← Back to Question List
C Code Walkthrough #21

Do-While Runs at Least Once

mediumLoops

📄 Code

Read carefully — what does this print?
1#include <stdio.h>
2int main() {
3 int count = 0, n = 0;
4 do {
5 count++;
6 n--;
7 } while (n > 0);
8 printf("%d\n", count);
9 return 0;
10}

🎯 Your Answer