need help with a c program (12 days of christmas)
Code:
int main ()
{
int day;
printf("Enter the number of the required verse\n");
scanf("%d, &day");
if (day < 1 || day > 13)
{
printf("No such verse");
}
else {
printf("On the");
switch(day)
{
case 1:
printf("1st");
break;
case 2:
printf("2nd");
break;
case 3:
printf("3rd");
break;
default:
printf(day+"th");
}
printf("day of Christmas my true love gave to me,");
switch(day)
{
case 12:
printf("Twelve Drummers Drumming");
case 11:
printf("Eleven Pipers Piping" );
case 10:
printf("Ten Lords A-leaping" );
case 9:
printf("Nine Ladies Dancing" );
case 8:
printf("Eight Maids A-milking" );
case 7:
printf("Seven Swans A-swimming");
case 6:
printf("Six Geese A-laying" );
case 5:
printf("Five Golden Rings" );
case 4:
printf("Four Calling Birds" );
case 3:
printf("Three French Hens" );
case 2:
printf("Two Turtle Doves, and" );
case 1:
printf("A partridge in a pear tree");
}
return 0;
}
i am not sure what i am doing wrong. i tried running the program and it keeps crashing. Please Help! (I'm dieing here!) any help would be much appreciated. thank you for all your help in advance.