Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 종만북
- Math
- 정수론
- Python
- Algorithm
- 인프런
- BASIC
- C
- C언어
- String
- Algospot
- graph
- Cleancode
- BOJ
- programmers
- udemy
- 따배씨
- 생활코딩
- server
- 백준
- BFS
- dfs
- JavaScript
- sorting
- 따라하면서 배우는 C언어
- DP
- 따라하며 배우는 C언어
- web
- php
- greedy
Archives
- Today
- Total
몽상실현개발주의
[따배씨] 6.2 의사 코드 ~ 6.3 진입조건 루프 본문
따배씨 - 따라하며 배우는 C언어
6강 반복문
6.2 의사 코드 Pseudocode
- Pseudo : 가짜의, 거짓의
6.3 진입조건 루프 Entry-Condition Loop While
#include <stdio.h>
int main(){
/*
while (expression)
statement
*/
int i;
i = 1;
while (i < 5) // infinite loop
{
printf("Hi\n"); // iteration - 반복
}
i = 1;
while(--i < 5) // wrong direction
{
printf("Hi\n");
}
i = 1;
while (i < 5)
{
printf("i before = %d\n",i);
i++;
printf("i after = %d\n", i);
}
i = 10;
while (i++ < 5) // cnanot enter
{
printf("Hi\n");
}
/* Common Mistakes */
i = 0;
while (i < 3)
printf("%i\n", i);
i++; // indenting Mistake
i = 0;
while (i++ < 3); // null statement Mistake
printf("%i\n", i);
return 0;
}
- 읽기 편하고 명확하게 표현하는 코드가 좋은 코드
이 글의 모든 사진과 내용의 출처는 홍정모 교수님께 있음을 알려드립니다.
http://blog.naver.com/atelierjpro
http://www.inflearn.com/course/following-c
'Language > C' 카테고리의 다른 글
[따배씨] 6.5 사실과 거짓 ~ 6.6 _Bool 자료형 (0) | 2021.05.19 |
---|---|
[따배씨] 6.4 관계 연산자 (0) | 2021.05.19 |
[따배씨] 6.1 while 반복 루프에서 scanf()의 반환값 사용하기 (0) | 2021.05.19 |
[C] 형 변환 Type Conversion (0) | 2021.05.18 |
[따배씨] 5.12 함수의 인수와 매개변수 (0) | 2021.05.18 |
Comments