Complete the code to start a do-while loop that prints "Hello" once.
do {
Console.WriteLine("Hello");
} while ([1]);The do-while loop runs the block once before checking the condition. Using false stops the loop after one iteration.
Complete the code to repeat the loop while the variable count is less than 3.
int count = 0; do { Console.WriteLine(count); count++; } while ([1]);
The loop continues while count is less than 3, printing 0, 1, and 2.
Fix the error in the do-while loop condition to compile correctly.
int i = 0; do { Console.WriteLine(i); i++; } while ([1]);
The condition must be a boolean expression. i < 5 correctly checks if i is less than 5.
Fill both blanks to create a do-while loop that prints numbers 1 to 3.
int num = 1; do { Console.WriteLine(num); num[1]1; } while (num [2] 4);
Increment num with ++ and loop while num < 4 to print 1, 2, 3.
Fill all three blanks to create a do-while loop that prints even numbers from 2 to 6.
int val = [1]; do { Console.WriteLine(val); val [2] 2; } while (val [3] 8);
Start val at 2, add 2 each time with +=, and loop while val < 8 to print 2, 4, 6.