/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
int main() {
cout << "Calculatrice basique" << endl;
int operande1 = 0, operande2 = 0;
int res_add, res_sous, res_mult;
double res_div = 0.0; // division en double pour résultat décimal
cout << "Choisir l'operande1 : ";
cin >> operande1;
cout << "Choisir l'operande2 : ";
cin >> operande2;
res_add = operande1 + operande2;
res_sous = operande1 - operande2;
res_mult = operande1 * operande2;
if (operande2 != 0)
res_div = static_cast<double>(operande1) / operande2;
else
cout << " Division impossible (division par zéro)" << endl;
cout << "Addition : " << res_add << endl;
cout << "Soustraction : " << res_sous << endl;
cout << "Multiplication : " << res_mult << endl;
if (operande2 != 0)
cout << "Division : " << res_div << endl;
return 0;
}