Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 54 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. double zahl1;
  7. double zahl2;
  8. char art;
  9.     cout<<"Taschenrechner\n";
  10.     cout<<"Bitte gib den ersten Wert ein.\n";
  11.     cin>>zahl1;
  12.     cout<<"Bitte gib einen zweiten Wert ein.\n";
  13.     cin>>zahl2;
  14.     cout<<"Bitte gib die Rechenart(+,-,/,*) ein.\n";
  15.     cin>>art;
  16.     switch (art)
  17.  {
  18.     case '+' : cout << "Ergebnis = " << zahl1 + zahl2 << endl;
  19.     break;
  20.     case '-' : cout << "Ergebnis = " << zahl1 - zahl2 << endl;
  21.     break;
  22.     case '*' : cout << "Ergebnis = " << zahl1 * zahl2 << endl;
  23.     break;
  24.     case '/' : cout << "Ergebnis = " << zahl1 / zahl2 << endl;
  25.     break;
  26.    default : cout << "Keine gueltige Eingabe";
  27.  }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top