-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathio.c
More file actions
33 lines (29 loc) · 641 Bytes
/
io.c
File metadata and controls
33 lines (29 loc) · 641 Bytes
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
29
30
31
32
33
#include <stdio.h>
main() {
printf("EOF: %d\n", EOF);
int c;
int symbols = 0;
int lines = 0;
while ((c = getchar()) != EOF) {
if (c == '\t') {
printf("\\t");
} else if (c == '\n') {
printf("\\n\n");
} else {
putchar(c);
}
if (c == '\n') {
lines++;
}
symbols++;
}
printf("Lines read: %d\n", lines);
printf("Symbols read: %d\n", symbols);
int a;
//Note that there are no compile-time warnings
if (a = 0) {
printf("if\n");
} else {
printf("else\n");
}
}