Print the numbers 1 through 20 in a simple while statement - C Statement

C examples for Statement:while

Description

Print the numbers 1 through 20 in a simple while statement

Demo Code

#include <stdio.h>

int main( void ){
    int count = 1;

    while (count <= 20)
    {/* w ww .ja  va 2s .  co m*/
        printf("%d\n", count);
        count++;
    }
    return 0;
}

Result


Related Tutorials