Do-While Loop - C Statement

C examples for Statement:do while

Introduction

The do-while loop checks the condition after the code block.

It will always run through the code block at least once.

The while loop ends with a semicolon.

Demo Code

#include <stdio.h>
int main(void) {

    int j = 0;/*  w  ww  .  j ava  2 s. co  m*/
    do {
      printf("%d", j++); /* 0-9 */
    } while (j < 10);
}

Result


Related Tutorials