Complete the code to skip printing the number 3 using continue.
for (int i = 1; i <= 5; i++) { if (i == [1]) { continue; } Console.WriteLine(i); }
The continue statement skips the rest of the loop when i equals 3, so 3 is not printed.
Complete the code to skip even numbers using continue.
for (int i = 1; i <= 6; i++) { if (i % 2 == [1]) { continue; } Console.WriteLine(i); }
The condition i % 2 == 0 checks for even numbers. Using continue skips printing even numbers.
Fix the error in the loop to correctly skip negative numbers using continue.
int[] numbers = { 2, -1, 3, -4, 5 };
foreach (int num in numbers) {
if (num [1] 0) {
continue;
}
Console.WriteLine(num);
}The condition num < 0 checks for negative numbers. Using continue skips them.
Fill both blanks to skip numbers divisible by 3 and print the rest.
for (int i = 1; i <= 9; i++) { if (i [1] 3 == [2]) { continue; } Console.WriteLine(i); }
The modulus operator % checks remainder. If i % 3 == 0, the number is divisible by 3 and skipped.
Fill all three blanks to skip numbers less than 4 or greater than 7.
for (int i = 1; i <= 10; i++) { if (i [1] 4 [2] i [3] 7) { continue; } Console.WriteLine(i); }
The condition i < 4 || i > 7 skips numbers less than 4 or greater than 7 using continue.