I need to write a program that has the user input a command such as ADD (adds two numbers), SUB(subtracts two numbers), DIV( divides), MUL(multiplies) and then input the two numbers. The user is asked to input all three things at one time. Here is the code.
I am not getting the right answers. I think it has something to do with my if statements.
int performance(char, int, int);
scanf(" %3s %d %d", &com, &one, &two);
FI = performance( com, one, two);
printf("the answer is %d\n", FI);
int performance(char A, int B, int C)
if(A == ADD)
if(A == SUB)
final = B - C;
if(A == DIV)
final = B / C;
if(A == MUL)
final = B*C;