C examples for Statement:while
A counting while loop with upper limit
#include <stdio.h> int main(void) { const int NUMBER = 22; int count = 1; /*from www . j a v a 2 s . com*/ while (count <= NUMBER) { printf("Be my Valentine!\n"); count++; } return 0; }