xxxxxxxxxx
public class DoWhileLoop : MonoBehaviour
{
void Start()
{ // Difference is that it will run one time before is read
bool shouldContinue = false;
do
{
print ("Hello World");
}while(shouldContinue == true);
}
}
xxxxxxxxxx
The dowhile statement creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once.
xxxxxxxxxx
The dowhile statement creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once.
xxxxxxxxxx
<?php
$num=1;
do{
$num++;
echo"The number is ".$num."<br>";
}
while($num<=5);
//======output=====
/*
The number is 2
The number is 3
The number is 4
The number is 5
The number is 6
*/
?>