-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththisoldman.c
More file actions
67 lines (63 loc) · 1.37 KB
/
thisoldman.c
File metadata and controls
67 lines (63 loc) · 1.37 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
void chorus(int number)
{
char *num;
char *thing;
switch (number)
{
case 1:
num = "one";
thing = "on my thumb";
break;
case 2:
num = "two";
thing = "on my shoe";
break;
case 3:
num = "three";
thing = "on my knee";
break;
case 4:
num = "four";
thing = "on my door";
break;
case 5:
num = "five";
thing = "on my hive";
break;
case 6:
num = "six";
thing = "on my sticks";
break;
case 7:
num = "seven";
thing = "up in heaven";
break;
case 8:
num = "eight";
thing = "on my gate";
break;
case 9:
num = "nine";
thing = "on my spine";
break;
case 10:
num = "ten";
thing = "once again";
break;
}
printf("This old man, he played %s\n", num);
printf("He played knick-knack %s\n", thing);
printf("Knick-knack paddywhack, give your dog a bone\n");
printf("This old man came rolling home\n");
printf("\n");
}
int main(void)
{
int i;
for (i=1; i<=10; i++)
{
chorus(i);
}
return 0;
}