big loop problem

closed account (SEbXoG1T)
#include <iostream>

using namespace std;
int main() {
double a,b;
char answer;
cout<<"what operation do you wish to do? ";
cin>>answer;
switch (answer) {
case '*':
cout<<"multiplication";
cin>>a;
cout<<"* ";
cin>>b;
cout<<a*b;
cin.get();
cin.get();
break;
case '/':
cout<<"division";
cin>>a;
cout<<"/ ";
cin>>b;
cout<<a/b;
cin.get();
cin.get();
break;
case '+':
cout<<"addition";
cin>>a;
cout<<"+ ";
cin>>b;
cout<<a+b;
cin.get();
cin.get();
break;
case '-':
cout<<"subtraction";
cin>>a;
cout<<"- ";
cin>>b;
cout<<a-b;
cin.get();
cin.get();
break;

}
return 0;

}



I am trying to incorporate a loop in this so that i can keep going, but i dont know how.
Someone recently asked a very similar question here: http://www.cplusplus.com/forum/beginner/31245/page2.html
Topic archived. No new replies allowed.