1.

Give The Syntax Of Using The While Loop In A C# Program.?

Answer»

The syntax of using the while LOOP in C# is: 

while(condition) //condition
{
 //statements
}

You can find an example of using the while loop in C#: 

int i = 0;
while(i < 5)
{
 Console.WriteLine("{0} ", i);
 i++;
}

The OUTPUT of the preceding code is: 0 1 2 3 4 .

The syntax of using the while loop in C# is: 

while(condition) //condition
{
 //statements
}

You can find an example of using the while loop in C#: 

int i = 0;
while(i < 5)
{
 Console.WriteLine("{0} ", i);
 i++;
}

The output of the preceding code is: 0 1 2 3 4 .



Discussion

No Comment Found