my code
#include <stdio.h>
#include <cs50.h>
int animalCategory(void); //function prototype
int currencyCategory(void); //function prototype
int scienceCategory(void); // function prototype
int main()
{
int Main_menu = 0;
{
printf("\n\tTrivia Game\n");
printf("1.\tAnimal question\n");
printf("2.\tCurrency question\n");
printf("3.\tScience question\n");
printf("4.\tQuit\n");
scanf("%d", &Main_menu);
switch(Main_menu)
{
case 1:
if (animalCategory() == 1)
printf("\ncorrect!\n");
else
{
printf("\nIncorrect\n");
printf("The correct answer is Reindeer!\n");
}
break;
case 2:
if (currencyCategory() == 2)
printf("\nCorrect!\n");
else
{
printf("\nIncorrect!\n");
printf("The correct answer is Ecuador\n");
}
break;
case 3:
if (scienceCategory() == 3)
printf("\nCorrect!\n");
else
{
printf("\nIncorrect!\n");
printf("The correct answer is 4\n");
}
break;
case 4:
return 0;
}
//function definition
int animalCategory();
{
int iAnswer = 0;
system("clear");
printf("\tAnimal Category\n");
printf("\tWhat is the only kind of deer whose females have antlers?\n");
printf("1.\tReindeer\n");
printf("2.\tPringdeer\n");
printf("3.\tUggdeer\n");
scanf("%d", &iAnswer);
return iAnswer;
}
//function definition
int currencyCategory();
{
int iAnswer = 0;
system("clear");
printf("\n\tCurrency Category\n");
printf("\tU.S dollar is the official currency of which latin American Nation?\n");
printf("1.\tColombia\n");
printf("2.\tEcuador\n");
printf("3.\tArgentina\n");
scanf("%d", &iAnswer);
return iAnswer;
}
//function definition
int scienceCategory();
{
int iAnswer = 0;
system("clear");
printf("\n\tScience Category\n");
printf("How many planets in our solar system are smaller than the Earth?\n");
printf("1.\t5\n");
printf("2.\t6\n");
printf("3.\t4\n");
scanf("%d", &iAnswer);
return iAnswer;
}
}
}
latest compiler error
/home/ubuntu/workspace/fooling/ $ make trivia
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow trivia.c -lcs50 -lm -o trivia
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 21
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2