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

Post-Increment in the Loop Test

hardLoops

📄 Code

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

🎯 Your Answer