hi
i am trying to write a simple calculator.i have posted the code below,it works fine for one time solution. but i want the answer to be used for next calculation and also want to put a code to end the program.
int A,B,C;
char op;
cout<< "Enter a number " <<endl;
cin >> A;
cout<<"Enter a operator " << endl;
cin >> op ;
cout<<"Enter a number " << endl;
cin >> B;
switch (op)
{
case '+':
cout<<"The answer is "<<A+B<< endl;
break;
case '-':
cout<<"The answer is "<<A-B<<endl;
break;
case '*':
cout<<"The answer is "<<A*B<< endl;
break;
case '/':
cout<<"The answer is "<<A/B<<endl;
break;
}