Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int rechenoption;
- int zahl1, zahl2;
- cout << "Taschenrechner" << endl;
- cout << "Bitte waehle die gewünschte Option! " << endl;
- cout << "1. Addition." <<endl;
- cout << "2. Substration" <<endl;
- cout << "3. Multiplikation" <<endl;
- cin >> rechenoption;
- if (rechenoption == 1)
- {
- cout << "Sie haben sich für Addition entschieden" << endl;
- cout << " Bitte geben Sie zwei Zahlen ein" << endl;
- cin >> zahl1;
- cout << "Zweite Zahl:";
- cin >> zahl2;
- cout << zahl1 << " + " << zahl2 << " = " << (zahl1 + zahl2) << endl;
- }
- if (rechenoption == 2)
- {
- cout << "Sie haben sich für Substration entschieden" << endl;
- cout << " Bitte geben Sie zwei Zahlen ein" << endl;
- cin >> zahl1;
- cout << "Zweite Zahl:";
- cin >> zahl2;
- cout << zahl1 << " - " << zahl2 << " = " << (zahl1 - zahl2) << endl;
- system("Pause");
- }
- if (rechenoption == 3)
- {
- cout << " Sie haben sich fuer die Multiplikation entschieden" << endl;
- cout << " Bitte geben Sie zwei Zahlen ein" << endl;
- cout << " Zahl 1: " << endl;
- cin >> zahl1;
- cout << "Zahl 2: " << endl;
- cin >> zahl2;
- cout << zahl1 << " * " << zahl2 << " = " << (zahl1 * zahl2) << endl;
- system ("Pause");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement