-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathll_equal.c
More file actions
43 lines (35 loc) · 786 Bytes
/
ll_equal.c
File metadata and controls
43 lines (35 loc) · 786 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
34
35
36
37
38
39
40
41
42
43
#include <stdio.h>
/* Only change any of these 4 values */
#define V0 0
#define V1 -1
#define V2 0
#define V3 0
int main(void) {
int a;
char *s;
printf("Berkeley eccentrics:\n====================\n");
/* for loop */
for(a=0; a<V0; a++) {
printf("Happy ");
}
printf("\n");
/* switch statement */
switch(V1) {
case 0: printf("Yoshua\n");
case 1: printf("Triangle Man\n"); break;
case 2: printf("Chinese Erhu Guy\n");
case 3: printf("Yoshua\n"); break;
case 4: printf("Dr. Jokemon\n"); break;
case 5: printf("Hat Lady\n");
default: printf("I don't know these people!\n");
}
/* ternary operator */
s = (V3==3) ? "Go" : "Boo";
/* if statement */
if(V2) {
printf("\n%s BEARS!\n",s);
} else {
printf("\n%s CARDINAL!\n",s);
}
return 0;
}