Top Banner
ANSI/ISO C Programming shcho.pe.kr 제 24 제 제제 제제 : switch 제
23

ANSI/ISO C Programming shcho.pe.kr 제 24 강 다중 선택 : switch 문.

Dec 31, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
PowerPoint Template A~J
A 10 B 9, C 8,D 7.5, E 7 F 6 5
if (grade==‘A’)

while ((c=getchar())!=EOF){
Remember
case break ! ( )
Make sure you ‘break’, unless you don’t really want it.
ISO C programming
while ((c=getchar())!=EOF){
case 'o' : case 'u' :
lab24_03 (case3.c)
, .
Data: “Plus is written as ‘+’, Increment is written as ‘++’, and multiplication is written as ‘*’.”
ISO C programming
switch-case
if (c =='A') capital ++;
if (c =='B') capital ++;
if (c =='C') capital ++;
if (c =='D') capital ++;
if (c =='E') capital ++;
lab24_04 (case4.c)
EOF , .
'A'-'a' = 'B'-'b' = ... .
:

ANSI/ISO C Programming