create a loop that prints joe biden four times in csharp

You can use a simple for loop to achieve this task in C# as follows:

main.cs
for(int i=0; i<4; i++)
{
    Console.WriteLine("Joe Biden");
}
63 chars
5 lines

In the above loop, we have initialized a counter variable i to 0 and the loop will continue until the condition i<4 is true. The Console.WriteLine("Joe Biden"); statement is executed four times as the loop runs because it is within the loop code block.

related categories

gistlibby LogSnag