C examples for Statement:while
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.
#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 */ } }