//simulation d'une calculatrice #include using namespace std; int main() { int i = 1; //variable de control pour la boucle do do { int op1, op2; cout << "Entrer les deux operandes : " << endl; cin >> op1 >> op2; char opera; cout << "Chosir l'operation: +, - , *, /, ou %: "; cin >> opera; switch (opera) { case ('+'): cout << op1 << opera << op2 << " = " << op1 + op2 << endl; break; case ('-'): cout << op1 << opera << op2 << " = " << op1 - op2 << endl; break; case ('*'): cout << op1 << opera << op2 << " = " << op1 * op2 << endl; break; case ('/'): cout << op1 << opera << op2 << " = " << op1 / op2 << endl; break; case ('%'): cout << op1 << opera << op2 << " = " << op1 % op2 << endl; break; default: cout << "l'operation " << opera << " n'est pas definie" << endl; break; } cout << "Voulez vous continuer (1 = oui, 0 = no) ?" << endl; cin >> i; } while (i); return 0; }