Question 6
What will be printed by the following program?
#include <stdio.h>
int main(void) {
int i = 0;
while (i < 5) {
if (i == 3) {
i++;
continue;
}
printf("%d ", i);
i++;
}
return 0;
}Detailed Solution
When i=3, i is incremented to 4 and 'continue' skips printing 3. For i=0, 1, 2, and 4, it prints the number normally.