Im trying to figure out how i can solve an equation that has been stored in an array.
I need some guidance on how to conquer such problem.
here is my conditions
- i have an array int X[30];
- and in there i have stored my desired equation: 5+6*20/4
- as well, i couldnt store the operants (+ / – * ) so i used different identifiers for them like ( -1 -2 -3 -4 ) because there should not be a negative value in the equation.
any help would be greatly appreciated
thanks
Normally, you have to define the priority of each operation and process each of them one by one.
ADDED: Here is the C code.
And here is the result:
This should works.
Enjoy coding.