While Loop Example

#include <stdio.h>

int main() {
    // Using a while loop to print numbers from 1 to 5
    printf("While Loop Example:\n");
    int i = 1;
    while (i <= 5) {
        printf("%d\n", i);
        i++;
    }

    return 0;
}
chevron_left
chevron_right

Leave a comment

Your email address will not be published. Required fields are marked *

Comment
Name
Email
Website