heres my code
but the the program ends how i make it so that i can go and choose something elseCode:#include<iostream>//cout i think using namespace std; int main() { int x;//the x int y;//the y int input;//another thing cout<<"1. multiply\n"; cout<<"2. devide\n"; cout<<"3. addition\n"; cout<<"4. subtraction\n"; cout<<"please provide the number listed\n"; cin>> input; switch ( input ) { case 1: cout<<"please provide 2 numbers to be multiplied\n"; cin>> x >> y ; cin.ignore(); cout<<( x*y ); cin.get(); break; case 2: cout<<"please provide 2 numbers to be devided\n"; cin>> x >> y ; cin.ignore(); cout<<( x/y ); cin.get(); break; case 3: cout<<"pls provide 2 numbers to be added\n"; cin>> x >> y ; cin.ignore(); cout<<( x+y ); cin.get(); break; case 4: cout<<"pls provide 2 numbers to be subtracted\n"; cin>> x >> y ; cin.ignore(); cout<<( x-y ); cin.get(); break; } }



LinkBack URL
About LinkBacks


