SlideShare a Scribd company logo
1 of 9
Download to read offline
C !
http://blog.naver.com/ruvendix
반복문의 필요성
printf()로 숫자를 100번출력하고 싶은데… 어떻게 하지…?
printf(); printf(); printf(); printf(); printf(); printf(); printf(); …
이건 너무 미친 짓같다… 새로운 방법이 필요해!
그래! 반복 작업을 할 수 있는 문법을 제공하자!
http://blog.naver.com/ruvendix
반복문 for문
반복할 횟수를 이용할 때 적합한 문법!
http://blog.naver.com/ruvendix
반복문 while문
조건식이 중심일 때 적합한 문법!
http://blog.naver.com/ruvendix
선택문 필요성
iSelect가 1일 때는 printf()를 호출하고, 2일 때는 scanf()를 호출하고 싶은데…
이렇게 조건에 따라 작업을 다르게 처리할 수 있으면 얼마나 좋을까…
그래! 조건에 따라 작업을
선택할 수 있는 문법을 제공하자!
http://blog.naver.com/ruvendix
if ~ else if ~ else문
if가 아니면 else if 실행, else if도 아니면 else 실행
http://blog.naver.com/ruvendix
switch ~ case문
case는 label(위치를 나타내는 문장)이라 쌍반점(:)을 써야 함!
http://blog.naver.com/ruvendix
break와 continue
반복문과 switch ~ case문을 빠져나가려면?
break를 사용하라!
반복문에서 현재 작업을 중단하고 다음 조건으로 넘어가려면?
continue를 사용하라!
http://blog.naver.com/ruvendix

More Related Content

Viewers also liked

자료형과 값
자료형과 값자료형과 값
자료형과 값. Ruvendix
 
Diario Resumen 20170318
Diario Resumen 20170318Diario Resumen 20170318
Diario Resumen 20170318Diario Resumen
 
Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!PGConf APAC
 
The large-scale nebular pattern of a superwind binary in an eccentric orbit
The large-scale nebular pattern of a superwind binary in an eccentric orbitThe large-scale nebular pattern of a superwind binary in an eccentric orbit
The large-scale nebular pattern of a superwind binary in an eccentric orbitSérgio Sacani
 
As viagens-marítimas-do-século-xv-slide
As viagens-marítimas-do-século-xv-slideAs viagens-marítimas-do-século-xv-slide
As viagens-marítimas-do-século-xv-slidePIBIDSolondeLucena
 
устав новый окончательный
устав новый окончательныйустав новый окончательный
устав новый окончательныйeid1
 
3Com JD062A
3Com JD062A3Com JD062A
3Com JD062Asavomir
 
TAKWIM SEKOLAH SMPKVSA 2017
TAKWIM SEKOLAH SMPKVSA 2017TAKWIM SEKOLAH SMPKVSA 2017
TAKWIM SEKOLAH SMPKVSA 2017Teacher
 
The ethics of educational & social research
The ethics of educational & social researchThe ethics of educational & social research
The ethics of educational & social researchHasmine Alcodia
 
Consonants
ConsonantsConsonants
Consonantsdien96
 
Temas biblicos
Temas biblicosTemas biblicos
Temas biblicosIvan Ask
 
Universidad católica luis amigó
Universidad católica luis amigóUniversidad católica luis amigó
Universidad católica luis amigójajaramillobe
 
Actividad física y deporte
Actividad física y deporteActividad física y deporte
Actividad física y deporteangelms2113
 
Lenguajes de interfaz sw assembler
Lenguajes de interfaz sw assemblerLenguajes de interfaz sw assembler
Lenguajes de interfaz sw assemblerChente_Fdz
 
კათოლიკე მეფეები
კათოლიკე მეფეებიკათოლიკე მეფეები
კათოლიკე მეფეებიMaia Esartia
 
Presentación1saia
Presentación1saiaPresentación1saia
Presentación1saiaomgmrcc
 

Viewers also liked (20)

배열
배열배열
배열
 
자료형과 값
자료형과 값자료형과 값
자료형과 값
 
Diario Resumen 20170318
Diario Resumen 20170318Diario Resumen 20170318
Diario Resumen 20170318
 
Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!
 
Hello world
Hello worldHello world
Hello world
 
Bierun
BierunBierun
Bierun
 
The large-scale nebular pattern of a superwind binary in an eccentric orbit
The large-scale nebular pattern of a superwind binary in an eccentric orbitThe large-scale nebular pattern of a superwind binary in an eccentric orbit
The large-scale nebular pattern of a superwind binary in an eccentric orbit
 
As viagens-marítimas-do-século-xv-slide
As viagens-marítimas-do-século-xv-slideAs viagens-marítimas-do-século-xv-slide
As viagens-marítimas-do-século-xv-slide
 
устав новый окончательный
устав новый окончательныйустав новый окончательный
устав новый окончательный
 
3Com JD062A
3Com JD062A3Com JD062A
3Com JD062A
 
TAKWIM SEKOLAH SMPKVSA 2017
TAKWIM SEKOLAH SMPKVSA 2017TAKWIM SEKOLAH SMPKVSA 2017
TAKWIM SEKOLAH SMPKVSA 2017
 
The ethics of educational & social research
The ethics of educational & social researchThe ethics of educational & social research
The ethics of educational & social research
 
Ktl
KtlKtl
Ktl
 
Consonants
ConsonantsConsonants
Consonants
 
Temas biblicos
Temas biblicosTemas biblicos
Temas biblicos
 
Universidad católica luis amigó
Universidad católica luis amigóUniversidad católica luis amigó
Universidad católica luis amigó
 
Actividad física y deporte
Actividad física y deporteActividad física y deporte
Actividad física y deporte
 
Lenguajes de interfaz sw assembler
Lenguajes de interfaz sw assemblerLenguajes de interfaz sw assembler
Lenguajes de interfaz sw assembler
 
კათოლიკე მეფეები
კათოლიკე მეფეებიკათოლიკე მეფეები
კათოლიკე მეფეები
 
Presentación1saia
Presentación1saiaPresentación1saia
Presentación1saia
 

More from . Ruvendix

Google coding guide
Google coding guideGoogle coding guide
Google coding guide. Ruvendix
 
상속과 다형성
상속과 다형성상속과 다형성
상속과 다형성. Ruvendix
 
연산자 오버로딩
연산자 오버로딩연산자 오버로딩
연산자 오버로딩. Ruvendix
 
클래스의 추가 지식
클래스의 추가 지식클래스의 추가 지식
클래스의 추가 지식. Ruvendix
 
여러 생성자
여러 생성자여러 생성자
여러 생성자. Ruvendix
 
클래스의 기초 지식
클래스의 기초 지식클래스의 기초 지식
클래스의 기초 지식. Ruvendix
 
Hello c++ world
Hello c++ worldHello c++ world
Hello c++ world. Ruvendix
 

More from . Ruvendix (13)

Google coding guide
Google coding guideGoogle coding guide
Google coding guide
 
형식 선정
형식 선정형식 선정
형식 선정
 
예외 처리
예외 처리예외 처리
예외 처리
 
템플릿
템플릿템플릿
템플릿
 
상속과 다형성
상속과 다형성상속과 다형성
상속과 다형성
 
연산자 오버로딩
연산자 오버로딩연산자 오버로딩
연산자 오버로딩
 
클래스의 추가 지식
클래스의 추가 지식클래스의 추가 지식
클래스의 추가 지식
 
여러 생성자
여러 생성자여러 생성자
여러 생성자
 
클래스의 기초 지식
클래스의 기초 지식클래스의 기초 지식
클래스의 기초 지식
 
Hello c++ world
Hello c++ worldHello c++ world
Hello c++ world
 
전처리기
전처리기전처리기
전처리기
 
동적할당
동적할당동적할당
동적할당
 
구조체
구조체구조체
구조체
 

반복문과 선택문