C examples for Statement:while
Produces a table of first 20 squares with while loop
#include <stdio.h> int main(void) { int num = 1;/*from ww w . j a v a 2 s . c om*/ while (num < 21) { printf("%4d %6d\n", num, num * num); num = num + 1; } return 0; }