#include <stdio.h>

int main() {
    // 초기값 선언;
    // while (조건) {
    //     // 반복할 코드 (증감 포함)
    // }

    int i = 3;
    while (i > 0) {
        printf("%d\n", i--);
        //i = i - 1;
    }

    int a = 0;
    while (a <= 5) {
        printf("a는 %d\n", ++a);
    }


    printf("----문제----\n");
    int b = 5;
    while (b < 10) {
        printf("%d ", ++b);
    }

    printf("\n----숙제----\n");
    int battery = 100;
    while (battery >= 0) {
        printf("배터리 잔량 : %d\n", battery);
        battery = battery - 25;
    }
    printf("전원이 꺼졌습니다\n");



    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: