Advertisement
Guest User

Untitled

a guest
Dec 11th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.97 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int rechenoption;
  9.     int zahl1, zahl2;
  10.    
  11.    
  12.     cout << "Taschenrechner" << endl;
  13.     cout << "Bitte waehle die gewünschte Option! " << endl;
  14.     cout << "1. Addition." <<endl;
  15.     cout << "2. Substration" <<endl;
  16.     cout << "3. Multiplikation" <<endl;
  17.     cin >> rechenoption;
  18.    
  19.     if (rechenoption == 1)
  20.     {
  21.                      cout << "Sie haben sich für Addition entschieden" << endl;
  22.                      cout << "  Bitte geben Sie zwei Zahlen ein" << endl;
  23.                      cin >> zahl1;
  24.                      cout << "Zweite Zahl:";
  25.                      cin >> zahl2;
  26.                      cout << zahl1 << " + " << zahl2 << " = " << (zahl1 + zahl2) << endl;
  27.                      }
  28.     if (rechenoption == 2)
  29.    
  30.    
  31.     {
  32.    
  33.                      cout << "Sie haben sich für Substration entschieden" << endl;
  34.                      cout << "  Bitte geben Sie zwei Zahlen ein" << endl;
  35.                      cin >> zahl1;
  36.                      cout << "Zweite Zahl:";
  37.                      cin >> zahl2;
  38.                      cout << zahl1 << " - " << zahl2 << " = " << (zahl1 - zahl2) << endl;
  39.                      
  40.                      system("Pause");
  41.                      
  42.     }
  43.    
  44.     if (rechenoption == 3)
  45.    
  46.    
  47.     {
  48.                      cout << " Sie haben sich fuer die Multiplikation entschieden" << endl;
  49.                      cout << " Bitte geben Sie zwei Zahlen ein" << endl;
  50.                      cout << " Zahl 1: " << endl;
  51.                      cin >> zahl1;
  52.                      cout << "Zahl 2: " << endl;
  53.                      cin >> zahl2;
  54.                      cout << zahl1 << " * " << zahl2 << " = " << (zahl1 * zahl2) << endl;
  55.                      
  56.                      system ("Pause");
  57.                      }
  58.                      }
  59.                      
  60.                      
  61.                      
  62.                      
  63.  
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement