Need simple help

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

example if i run a program so it should say:

Enter question:

and i write,

Enter question: 2+3=

so by pressing enter it should give answer

Enter question: 2+3=5
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 char variable 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 the case statement again.

3. You name it.
Topic archived. No new replies allowed.