반응형
1 2 3 4 5 6 7 8 9 10 11 | #include <iostream> using namespace std; int main(){ bool largefile; unsigned int filesize; largefile = filesize > 1024 * 1024 ? true : false; return 0; } | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <iostream> using namespace std; int main(){ bool largefile; unsigned int filesize; if(filesize > 1024 * 1024){ largefile = true; } else { largefile = false; } return 0; } | cs |
[예제 1-2] 예제 1-1을 if문으로 바꾼 결과
반응형
'공부 > 개발노트' 카테고리의 다른 글
성적표 입력 프로그램(공부용) (0) | 2016.08.17 |
---|---|
[C/C++] for문을 while문으로 바꿔보기 (0) | 2016.08.17 |
[C/C++] if문을 switch문으로 변경해보기 (0) | 2016.08.17 |
[C/C++] do while문 사용 예문 (0) | 2016.08.17 |
[C/C++] while문으로 구구단 만들기 (0) | 2016.08.17 |