Code:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#pragma warning(disable:4996)
int menu();
void additionmenu();
void subtractionmenu();
void multiplicationmenu();
void addEasy();
void addMedium();
void addDifficult();
int main()
{
int choice = menu();
printf("You have selected the choice %d", choice);
if (choice == 1)
{
printf("You have selected addition\n");
additionmenu();
}
else if (choice == 2)
{
printf("You have selected subtraction\n");
subtractionmenu();
}
else if (choice == 3)
{
printf("You have selected multiplication\n");
multiplicationmenu();
}
else
{
printf("Invalid choice\n");
}
system("pause");
}
int menu()
{
int choice;
printf("1.addition\n");
printf("2.subtraction\n");
printf("3.multiplication\n");
printf("Please choose either 1,2 or 3:\n");
scanf("%d", &choice);
(getchar() != '\n');
return choice;
}
void additionmenu()
{
char choice;
printf("Please select the level\n");
printf("A level 1\n");
printf("B level 2\n");
printf("C level 3\n");
scanf("%c", &choice);
if (choice == 'A' || choice == 'a')
{
printf("You have selected level 1\n");
addEasy();
}
else if (choice == 'B' || choice == 'b')
{
printf("You have selected level 2\n");
addMedium();
}
else if (choice == 'C' || choice == 'c')
{
printf("You have selected level 3\n");
addDifficult();
}
else
{
printf("Invalid choice\n");
}
}
void subtractionmenu() {
printf("To Do\n");
}
void multiplicationmenu() {
printf("To Do\n");
}
void addEasy() {
int n1, n2, pcans, userans;
int count = 1, mark = 0;
char choice;
printf("Welcome to addition level 1\n");
do {
srand((unsigned int)time(NULL));
n1 = rand() % 10;
n2 = rand() % 10;
pcans = n1 + n2;
printf("%d.%d+%d>", count, n1, n2);
scanf("%d", &userans);
if
(userans == pcans) {
printf("You are right\n");
mark = mark + 10;
}
else
{
printf("You are wrong\n");
}
count++;
} while (count <= 10);
system("pause");
system("cls");
printf("Your score is %d", mark);
rewind(stdin);
if (mark >= 80)
{
printf("Congratulation!!! you pass level1!!\n");
printf("Do you want move to next level?(Y/N)\n");
scanf("%c", &choice);
switch (choice)
{
case'Y':
case'y': {printf("addMedium)()");
break; }
case'N':
case'n': {system("exit");
break; }
default:
{ printf("Invalid!!\n");
printf("You are back to main menu.\n");
system("pause");
additionmenu();
}
}
}
void addMedium(); {
printf("That's a bit harder\n");
}
void addDifficult(); {
printf("That's really tricky\n");
}
}
can someone help me....it show error at line 1 unresolved external symbol _addMedium referenced in function _additionmenu