+ 2
How to take unlimited input in calculator in C coding? calculator ex:12+38-7+88*7
4 Answers
0
Ishfak Afiq such an input is possible.
Take input as a string.
Then store the numbers in an array by iterating over the string.
If you want it to be like a calculator...
Then in a loop( iterating over the string) , check for the operators (+,-,*,etc.) and based on if conditions or switches do the appropriate action the adjacent/numbers beside the operators numbers and continue the loop till it reaches the last number.
+ 2
calculator ex:12+38-7+88*7
+ 1
What do you mean in âunlimited inputâ? Could you show a few examples?
0
Send code