Code:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#pragma warning(disable:4996)
int menu();
void additionmenu();
void subtractionmenu();
void multiplicationmenu();
void main()
{
int choice;
//printf("You have selected the choice %d",menu());
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:");
scanf("%d", &choice);
return choice;
}
void additionmenu()
{
char choice;
printf("Please select the level");
printf("A level 1");
printf("B level 2");
printf("C level 3");
scanf("%c", &choice);
if (choice == A)
{
printf("You have selected level 1\n");
additionmenu();
}
else if (choice == B)
{
printf("You have selected level 2\n");
subtractionmenu();
}
else if (choice == C)
{
printf("You have selected level 3\n");
multiplicationmenu();
}
else
{
printf("Invalid choice\n");
}
int n1, n2, pcans, userans;
int count = 1, mark = 0;
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 + 5;
}
else
{
printf("You are wrong\n");
}
count++;
} while (count <= 3);
printf("Your score is %d", mark);
}
its show error at line 58,63,68,84,96 pls help me