-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsong.c
42 lines (34 loc) · 1.12 KB
/
song.c
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
/****************************************************************************
* song.c
* Computer Science 50
* Nataliia Vynogradenko
*
* Printing song
***************************************************************************/
#include <stdio.h>
#include <cs50.h>
int main(void)
{
string lastForFirst[10] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"};
string lastForSecond[10] = {"thumb", "shoe", "knee", "door", "hive", "sticks", "heaven", "gates", "spine", "again"};
for (int i = 0; i < 10; i++)
{
printf("This old man, he played %s", lastForFirst[i]);
printf("\n");
if (i == 6)
{
printf("He played knick-knack up in %s", lastForSecond[i]);
}
else if (i == 9)
{
printf("He played knick-knack once %s", lastForSecond[i]);
}
else
{
printf("He played knick-knack on my %s", lastForSecond[i]);
}
printf("\n");
printf("Knick-knack paddywhack, give your dog a bone\nThis old man came rolling home \n");
}
return 0;
}