vendredi 8 octobre 2021

Take multiple inputs from the user

I am stuck on a problem in which the user can enter any of the following inputs and i have to evaluate it the expression using c++. How can I solve this?

2 + 3 / 2 =

2+ 2 =

2*3.2 =

int num1,num2;

string oper, equal;

cout<<"Input the formula: ";

cin>>num1>>oper>>num2>>equal;

Aucun commentaire:

Enregistrer un commentaire