for (int i = 0; i < 10; i++) { Console.WriteLine("Value of i: " + i); }
if (x > y) { Console.WriteLine("x is greater than y."); } else { Console.WriteLine("y is greater than or equal to x."); }In this example, the block is used to contain the statements that will be executed if the condition in the if statement is true. If the condition is false, the statements in the else block will be executed instead. Package library: System