kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

ctl_dowhile.c (351B)


      1 /* A do/while loop: the condition is tested at the bottom, so the body always
      2  * runs once and the back-edge is a single conditional branch. volatile bound
      3  * keeps it real. Adds 7 each pass until reaching 42 (7*6). Exit code 42. */
      4 int test_main(void) {
      5   volatile int limit = 42;
      6   int v = 0;
      7   do {
      8     v += 7;
      9   } while (v < limit);
     10   return v;
     11 }