While Loop in C
Level 251 keystrokes
Uses a while loop that prints i and adds 1 to it as long as i is less than 3, producing "0 1 2".
C code
// The loop counter starts at 01int i = 0;// The condition is checked before each pass; the loop stops once i reaches 32while (i < 3) { // Prints the current value followed by a space: 0, 1, then 23 printf("%d ", i); // Moves i toward 3; without this line the loop would never end4 i++;5}Output
0 1 2
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.
;× 3"× 2(× 2)× 2+× 2,× 1{× 1}× 1%× 1<× 1