C - Loops
Which of the following code snippets correctly demonstrates a
do-while loop in C that prints numbers from 1 to 3?do-while loop in C that prints numbers from 1 to 3?do { ... } while (condition);. int i = 1;
while (i <= 3) {
printf("%d ", i);
i++;
} is a while loop, not do-while. int i = 1;
do {
printf("%d ", i);
i++;
} while i <= 3; and D miss parentheses around the condition, which is a syntax error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions