I had to write a program for a simple math game, i wrote the program it had a few errors i fixed the errors, or so i thought, the program compiled but then when i went to run the exe file i got 3 error LNK2019: unresolved external symbols _If
_mult
_sub
i have no idea how to resolve these 3 errors nor what the error is referring to, an insight would be greatly appreciated.
Here is my Code for the Program.
Code:
#include <stdio.h>
int sub ( int x, int y );
int div ( int x, int y );
int mult ( int x, int y );
int add ( int x, int y );
int func;
int s;
int d;
int m;
int a;
int x;
int y;
float num;
int q;
int yes;
int no;
int Yes;
int No;
int main()
{
{
printf("Please enter a number: /n 1 To Play/n 2 Instructions/n 3 Exit/n");
scanf("%f", &num);
}
{
If (num == 1) ;
printf("Press a to Add/n s to subtract/n d to divide/n m to multiple/n");
scanf("%d", &func );
}
{
If (func == s);
printf( "Please input two numbers to be subtracted: " );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The subtraction of your two numbers is %d\n", sub( x, y ) );
getchar();
}
{
int sub (int x, int y);
}
{
return x - y;
}
{
If (func == m);
printf( "Please input two numbers to be multiplied: " );
/* 50 */ scanf( "%d", &x );
scanf( "%d", &y );
printf( "The product of your two numbers is %d\n", mult( x, y ) );
getchar();
}
{
int mult (int x, int y);
}
{
return x * y;
/* 60 */ }
{
If (func == d);
printf( "Please input two numbers to be divided: " );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The division of your two numbers is %d\n", div( x, y ) );
getchar();
}
{
/* 70 */ int div (int x, int y);
}
{
return x / y;
}
{
If (func == a);
printf( "Please input two numbers to be added: " );
scanf( "%d", &x );
scanf( "%d", &y );
/* 80 */ printf( "The addition of your two numbers is %d\n", div( x, y ) );
getchar();
}
{
int add (int x, int y);
}
{
return x + y;
}
{
If (num == 2);
printf("Instructions are as Follows:/n You will choose any two numbers you like/n You will then choose an operation to be performed/n enter a s m or d./n a is addition, s is subtraction, m is multiplication, and d is division./n After your choose your operation you will receive your total./n You can then choose to play again or exit the game.");
printf("Now Would you like to play the Game?(yes or no): ");
scanf("%d", &q);
}
{
If (q == yes || Yes);
printf("Press a to Add/n s to subtract/n d to divide/n m to multiple/n");
scanf("%d", &func );
}
{
If (q == no || No);
return 0;
}
{
If (num == 3);
return 0;
}
}