While Loop - Devbhoomi

FREE JOB ALERT & ONLINE TUTORIALS

Hot

Post Top Ad

Monday 6 November 2017

While Loop

#include <stdio.h>

int main()
{

    // Don't forget to declare variables

    int i = 0;

    // While i is less than 10
    while (i < 10)
    {

        printf("%d\n", i);
        // Update i so the condition can be met eventually
        i++;
    }
    return 0;
}
OUTPUT
0
1
2
3
4
5
6
7
8
9

No comments:

Post a Comment

Post Top Ad