Assalam-o-Alaikum!
Seniors i need help for a program that after
running ask for an input and when i write
as an input in one line 2+3= or different operator
like (-,*,/) and the program should give
the correct answer in the same line according to the operator
written between two numbers.
Advance thanks
You need to write some code first. Post it here. We will analyze it and help you if needed. :)
There are a couple of ways you could do this: 1. Have 2 integer or float variables that will hold your 2 numbers and a charvariable for the operation sign. Then with a simple case statement determine the operation that should be done.
2. Declare a std::string that will hold your "question". Then search through it and extract the needed parts into the proper variables. Then there's thecasestatement again.