To repeatedly perform the logic inside the loop while the condition holds true (you would expect something inside the code block to eventually cause the test condition to evaluate as false).
Most basic examples given in text books use an incrementing variable which could also be implemented as a for loop:
int i = 0;
do {
i++;
} while (i < 100);
A better example would be:
bool door_opened;
do {
door_opened = ring_doorbell(); /* an example function*/
} while (door_opened == false);
PS its probably 10 years since I wrote any C so syntax might not be 100% accurate.
Copyright © 2026 eLLeNow.com All Rights Reserved.