The difference between While and Do..While, is that "While" loops check the statements before executing the code inside them, and "Do..While" loops execute the code inside them before checking the statements.
for example:
#include <stdio.h>
int main(void) {
int a,b;
a = 0; b = 4;
while (b < a) {
printf("While 1\n");
}
do {
printf("While 2\n");
} while (b < a);
return 0;
}
the first printf never gets displayed because the comparison between a and b is made before executing the instructions inside the loop, and of course 4 < 0 is false.
The second printf does get displayed because the comparison is made AFTER the code inside the loop is executed once.
so, when you use "Do..While" loops the code inside them is executed AT LEAST once. That's not necessarily the case with "While" loops.