상세 컨텐츠

본문 제목

c 반복문

c언어

by bumychoi 2025. 2. 28. 12:45

본문

#include<stdio.h>

int main(void) {
printf("----while 문---- \n");
int i = 1;
while (i <= 10) {
printf("hi %d\n", i++);
}

printf("----do while 문---- \n");
int j = 1;
do {
printf("hi %d\n",j++);
} while (j <= 10);

printf("----for 문---- \n");
for (int a = 1; a <= 10; a++) {
printf("hi %d\n", a);
}
return 0;
}

'c언어' 카테고리의 다른 글

c 숫자 맞추기  (0) 2025.03.03
피라미드 2  (0) 2025.02.28
피라미드 만들기  (0) 2025.02.28
구구단 코드  (0) 2025.02.28
c언어 기초 입출력  (0) 2025.02.28

관련글 더보기