#include <iostream>
using namespace std;
int main() {
int opcion = 0;
while (opcion != 4) {
cout << "\n***** MENU DE OPERACIONES *****" << endl;
cout << "0. Sumar 1 + 1" << endl;
cout << "1. Restar 5 - 4" << endl;
cout << "2. Multiplicar 2 * 3" << endl;
cout << "3. Dividir 9 / 3" << endl;
cout << "4. Salir" << endl;
cout << "Seleccione una opcion: ";
cin >> opcion;
if (opcion == 0) {
cout << "Resultado: " << 1 + 1 << endl;
}
else if (opcion == 1) {
cout << "Resultado: " << 5 - 4 << endl;
}
else if (opcion == 2) {
cout << "Resultado: " << 2 * 3 << endl;
}
else if (opcion == 3) {
cout << "Resultado: " << 9 / 3 << endl;
}
else if (opcion == 4) {
cout << "Programa finalizado." << endl;
}
else {
cout << "Opcion no valida." << endl;
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: