`do` — C Keyword
`do` — C Keyword
The do keyword in C: a post-test loop that executes the body at least once.
`do` — C Keyword
The do keyword in C: a post-test loop that executes the body at least once.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
do (C)Executes the body at least once, then repeats while the condition is non-zero. The condition is checked after each iteration.
do statement while (condition);
#include <stdio.h>
int main(void) {
int n = 0;
do {
printf("%d ", n);
++n;
} while (n < 5);
/* Output: 0 1 2 3 4 */
printf("\n");
return 0;
}
while (condition) is mandatory.do-whileint main() {
// Pick one facility from this reference page.
// Write the smallest program that exercises its main precondition,
// complexity rule, or lifetime constraint before scaling up.
return 0;
}