I have a programme that must include two switched in a while loop, rather i am not sure if they have to be inside or if it doesn't matter. But i have written some coding, but it is incorrect, as i am not getting out the correct data. It should put out the first three verses of "The Twelve Days of Christmas", but it isn't.
Here is what I have so far:
#include <stdio.h>
int main()
{
int day;
char number;
printf("On the %d of Christman my true love gave to me:\n", day);
while (day++)
{
switch(day)
{
case 1:
day = 1;
continue;
case 2:
day = 2;
continue;
case 3:
day = 3;
continue;
}
switch (number)
{
case 1:
scanf("%d", &day);
printf("A partrige in a pare tree.");
continue;
case 2:
scanf("%d", &day);
printf("Two turtle doves.");
continue;
case 3:
scanf("%d", &day);
printf("Three french hens.");
continue;
}
}
return 0;
}
I am sure that my logic is incorrect. I can run this with out any syntax errors, but, as I stated before, I do not get the correct output.
ANy help would be greatly appreciated.
-Sacha