






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Detailed lecture notes on c programming by prof. Daeeun kim covering data types, operators (arithmetic, relational, logical, assignment), statements (assignment, conditional, loop), functions, recursion, and input/output. Includes examples and explanations.
Typology: Lecture notes
Uploaded on 09/24/2019
6 documents
1 / 30
This page cannot be seen from the preview
Don't miss anything!























2
Selective branch
if, switch
if statement if (condition) then S 1 else S 2
switch statement switch (variable) { cond1 : S1; break; cond2 : S2; break;
... condn : Sn; break; default : Sn+ }
cond S 1
false
true
S 2
S 1
cond 1 true
false
S 2
cond 2
Sn
false (^)... condn false Sn+ true true
4
cond S
false
true
5
S cond
true
false
7
8
Input function : scanf (argument_list); getchar(); read();
gets()
Output function : printf (argument_list); putchar();
write()
10
Prof. DaeEun Kim 11
13
14
16
17
변환명세에서 필드 폭(width)을 지정하려면 %f 사이에 폭을 기술
19
#include <stdio.h>
int main() {
printf("12345678901234567890\n"); printf("%10c\n", 'A'); printf("%10d\n", 128); printf("%10lf\n", 3.1415926); printf("%10le\n", 3.1415926); printf("%10.3lf\n", 3.1415926); return 0; }
3.141593e+ 3.
20