I am trying to have my switch case statements print with defined functions but they are not working. I have defined the statements, but it seems that the error is in the function itself.
Code:
#include <stdio.h>
#include <stdlib.h>
nstructions() {printf("\nHere are the instructions:"), printf("You may have myself or the computer give you a number.\n")};
user_guess(){printf("The number the computer is thinking of is...10.\n")};
computer_guess(){printf("\nThe number I'm thinking if is...5")};
main(void)
{
int menu_choice;
printf("\tGUESSING GAME /n");
//Menu list of choices
printf("1. Show me the instructions\n");
printf("2. Let the computer think of a number\n");
printf("3. I will think of a number\n");
printf("0. Quit\n");
do
{
printf("Enter your choice: ");
scanf(" %d", &menu_choice);
switch (menu_choice)
{
case (1): instructions();
break;
case (2): user_guess();
break;
case (3): computer_guess();
break;
case (4): exit(1); //Exits the program.
break;
//Validates input
default: printf("\n%d is not a valid choice.\n", menu_choice);
printf("Try again.\n");
break;
}
} while ((menu_choice < 1) || (menu_choice > 4));
return 0;
}