Hi,
I wrote a little C program for my programming class and it asks the user what operation they would like to perform (+, -, /, *, %). I currently just have if statements that say if its + then value1 + value2, etc. Is it possible to use the variable as an operator so I don't need all the if statements or am I better off leaving it as is?
Thanks for your time,
Andrew
I wrote a little C program for my programming class and it asks the user what operation they would like to perform (+, -, /, *, %). I currently just have if statements that say if its + then value1 + value2, etc. Is it possible to use the variable as an operator so I don't need all the if statements or am I better off leaving it as is?
Thanks for your time,
Andrew