How to enter multiple input

In this ques, I need to initially input *,/,+,-,% and then values.
how should I check compile and check for such input?

create a char for operator and integers for the two numbers. Then apply switch case depending on the operator do the corresponding operation