Originally Posted by
Salem
Post the whole code, not just single line snippets.
The errors are because you've generally messed up the balance of ( ) and brace pairs.
It's a lot of code and I'm scared no one would look at it, but here goes:
Code:
#include<stdio.h>#include<stdlib.h>
main()
{
int choice1;
int choice2;
printf("What do you want to see?\n");
printf("1. The 1980s\n");
printf("2. The 1990s\n");
printf("3. The 2000s\n");
printf("4. quit\n");
do
{
printf("Enter your choice: ");
scanf(" %d", &choice1);
switch (choice1)
{
case(1):
(
printf("\n\nWhat would you like to see?\n");
printf("1. baseball\n");
printf("2. The movies?\n");
printf("3. US Presidents\n");
printf("4. Quit\n");
printf("Enter your choice: ");
scanf(" %d", &choice2);
if (choice2 == 1)
{
printf("\n\nWorld Series Champions ");
printf("of the 1980s:\n");
printf(" 1980: Philies\n");
printf(" 1981: Dodgers\n");
printf(" 1982: dodgers\n");
printf(" 1983: Cardinals\n");
printf(" 1984: Tigers\n");
printf(" 1985: Tigers\n");
printf(" 1986: Royals\n");
printf(" 1987: Royals\n");
printf(" 1988: Twins\n");
printf(" 1988 As\n");
printf(" \n\n\n");
break;
} else if (choice2 == 2)
{
printf("\n\nOscar Winning movies in the 1980s:\n");
printf("1980: Ordinary people\n");
printf("1981: Chariots of Fire\n");
printf("1982: Gandi\n");
printf("1983: Terms of Endearment\n");
printf("1984: Amadeus\n");
printf("1985: Out of Africa\n");
printf("1986: POop\n");
printf("1987: The Last Emperor\n");
printf("1988: Rain man\n");
printf("1989: Driving Miss Daisy\n");
printf("\n\n\n");
break;
}else if (choice2 ==3)
{
printf("\n\nUS Presidents in the 1980s:\n");
printf("1980: Jimmy Carter\n");
printf("1984: Reagan\n");
printf("1988: George Bush\n");
printf("\n\n\n");
break;
}else if (choice2==4)
{
exit(1);
}else
{
printf("Sorry, not a valid choice!\n");
break;
}
)
case (2):
{
printf("\n\nWhat would you like to see?\n");
printf("1. Baseball\n");
printf("2. The movies\n");
printf("3. US Presidents\n");
printf("4. Quit\n");
printf("Enter your choice: ");
scanf(" %d", &choice2);
if (choice2 == 1)
{
printf("\n\nWorld Series Champions of ");
printf("the 1990s:\n");
printf("1990: reds\n");
printf("1991: reds\n");
printf("1992: twins\n");
printf("1993: Blue Jays\n");
printf("1994: blue jays\n");
printf("1995: Twins\n");
printf("1996: Braves\n");
printf("1997: Braves\n");
printf("1998: Marlins\n");
printf("1999: Yankees\n");
printf("\n\n\n");
break;
}else if (choice2 == 2)
{
printf("\n\nOscar Winning Movies in ");
printf("the 1990s:\n");
printf("1990: Dancing with Wolves\n");
printf("1991: Silence\n");
printf("1992: unforgiven\n");
printf("1993: Schnidlers list\n");
printf("1994: Enlgish\n");
printf("1995: Titanic\n");
printf("1996: Shakespears in love\n");
printf("1997: American beauty\n");
printf("\n\n\n");
break;
}else if (choice2 == 3 )
{
printf("\n\nUS Presidents in the 1990s\n");
printf("1992: Bush\n");
printf("1996: Clinton\n");
printf("\n\n\n");
break;
} else if (choice2 == 4)
{
exit(1);
} else
{
printf("sorry, no good\n");
}
}
case (3):
{
printf("\n\nWhat would you like to see?\n");
printf("1. baseball\n");
printf("2. movies\n");
printf("3. US presidents\n");
printf("4. Quit\n");
printf("Enter your choice: ");
scanf(" %d", &choice2);
if (choice2 ==1)
{
printf("\n\nWorld series champs of ");
printf("the 2000s:\n");
printf("2000: Yankees\n");
printf("2001: Diambonbacks\n");
printf("2002: Angels\n");
printf("2003: Angels\n");
printf("2004: marlins\n");
printf("2005: White sox\n");
printf("2006: Cardinals\n");
printf("2007: Red Sox\n");
printf("2008: Red sox\n");
printf("2009: Yankees\n");
printf("\n\n\n");
break;
}else if (choice2 == 2)
{ printf("\nOscar winning movies in ");
printf("the 2000s\n");
printf("2000: Gladiator\n");
printf("2001: MNind\n");
printf("2002: Chicago\n");
printf("2003: Lotr\n");
printf("2004: lotr\n");
printf("2005: million dollar baby\n");
printf("2006: crash\n");
printf("2007: Crash\n");
printf("2008: Hurt locker\n");
printf("2009: slumdog\n");
printf("\n\n\n");
break;
} else if (choice2 ==3)
{
printf("\n\nUS presidnets in the 2000s:\n");
printf("2000: Bill Clinton\n");
printf("2001-2008: George Bush\n");
printf("2009: Obama\n");
printf("\n\n\n");
break;
}else if (choice 2 ==4)
(
exit(1);
)else
{
printf("Sorry, not a valid choice.\n");
break;
}
}
}
case(4):
exit(1);
default: printf("\n%d is not a valid choice.\n", choice1);
printf("Try again.\n");
break;
} while (( choice1 <1) || ( choice1> 4));
return 0;
}
Errors are on lines :
28, 90 232, 234