while loop in c#
int i = 0;
while (i < 10)
{
Console.WriteLine("Value of i: {0}", i);
i++;
}
while loop in c#
int i = 0;
while (i < 10)
{
Console.WriteLine("Value of i: {0}", i);
i++;
}
While loop in c#
int i = 0;
while (i < 20)
{
Console.WriteLine(i);
i++;
}
c# while loop
while(condition)
{
statement(s);
}
_______________EX.___________________
int a = 0;
while (a < 10)
{
Console.WriteLine(a); //output>> 0 .. 1 .. 2 ........ 8 .. 9
a++;
}
c# do while or
int sugar = 0;
int salt = 0;
do {
bottle1.choose();
bottle2.choose();
if ((bottle1 == 'Sugar') && (bottle2 == 'Sugar'))
{
Console.Write("Sugar");
sugar++;
}
else if ((bottle1 == 'Salt') && (bottle1 == 'Salt'))
{
salt++;
Console.Write("Salt");
}
else
{
Console.Write("None");
}
} while ((salt < 10) || (sugar < 10));
c# do while loop
do
{
//code block
} while(condition);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us