In While loop the condition is tested first and then the statements are
executed if the condition turns out to be true.
In do while the statements are executed for the first time and then the
conditions are tested, if the condition turns out to be true then the
statements are executed again.
A typical scenario to use do While loop.
I would like to get a specified input from user. Here first I will get the
input then I will check whether we got the specified input other wise we
will again ask for the input.
eg.,
do
{
char input;
printf("say yes or no :(y/n)";
input = getchar();
}while(!(input == 'y' || input == 'n'));
"Logan Lee" <lo*********@student.uts.edu.auwrote in message
news:47***********************@news.optusnet.com.a u...
Hi. What's the difference between while and do while?