Hi,
As part of a project I have to create a calculator that allows the user to input 3 numbers, and two operators from the following: '+', '-', '*' , '/'.
The inputted operators gets assigned to a char variable (operator1 and operator2). This is done using scanf.
I want to be able to check that only one of the four operators: '+' , '-' , '*' and '/' has been assigned into each char variable and terminate the program if not.
So if either operator one or two do not contain either '+' , '-' , '*' or '/' the program would be terminated.
What would be the best way to approach this?
Any help wold be greatly appreciated thanks.