While Loop - C Statement

C examples for Statement:while

Introduction

The while loop runs the code block if its condition is true, and continue looping if the condition remains true.

The condition is only checked at the start of each iteration.

Demo Code

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

    int i = 0;//from w  w  w .  j a v  a2 s  .  c  o m
    while (i < 10) {
       printf("%d", i++); /* 0-9 */
    }
}

Result


Related Tutorials