Nested Loop in C
Level 3102 keystrokes
Uses nested for loops to print a 3x3 grid of two-digit numbers.
C code
// Outer loop: one pass per row (i = 1, 2, 3)1for (int i = 1; i <= 3; i++) { // Inner loop: runs completely (j = 1, 2, 3) for every i2 for (int j = 1; j <= 3; j++) { // Print i and j side by side, so i = 2, j = 3 shows as 233 printf("%d%d ", i, j);4 } // After the inner loop finishes, start a new row5 printf("\n");6}Output
11 12 13 21 22 23 31 32 33
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this C code and how often they appear.
;× 6"× 4(× 4)× 4+× 4=× 4,× 2{× 2}× 2%× 2