what on this code is wrong? https://code.sololearn.com/cAeQsgL9ClBI/?ref=app
2/4/2020 12:12:05 PM
Nicola43 Answers
New AnswerNicola Esu It works. try to change depending on needed one, by observing output what & how happening... printf("%d\n", tot); write this outside loop for final output only... 2+3-5+7-4= 3 output
my intent was to create a calculator that in a loop kept asking for numbers and symbols and when inserting the symbol = did all the operations. in this way it only does the operation between two numbers.
yes but only if I do for example num1 -or+ num2! if i want to make 10 - 5 + 3 + 2= don’t work!
if i want to make more operations at the same time i have to use the array for numbers to ?
if a user of my calculator would like to do a long calculation, for example 10 + 5 - 2 + 7 = how should i write?
the code is the same but for end the loop I have to insert the first = and then the second = otherwise it does not end
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message