
please wait
|
|
=
is for assignment, ==
is for comparison. So you are going to want to fix your if statements. I also would find it easier to use a switch instead.
|
|
|
|
|
|
if( s == '/' && b == 0 )
otherwise what happens if you try and do 4 + 0? You will get an error saying you can't divide by zero. One more thing to mention you should format your main function neatly like the calculation function it makes things much easier to read.