Advertisement
Guest User

AWP: 11 Variablen -- 3. Taschenrechner

a guest
Apr 18th, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. /**
  6.   * 3. Taschenrechner für zwei Zahlen mit den Ergebnissen Summe & Differenz & Produkt & Quotient.
  7.   *
  8.   */
  9.  
  10. int main() {
  11.     /*
  12.      * VARIABLES
  13.      */
  14.     float f_zahl_1, f_zahl_2;
  15.  
  16.     /*
  17.      * INPUT
  18.      */
  19.     cout << "Taschenrechner." << endl;
  20.     cout << "Bitte geben Sie die erste Zahl ein: ";
  21.     cin >> f_zahl_1;
  22.     cout << "Bitte geben Sie die zweite Zahl ein: ";
  23.     cin >> f_zahl_2;
  24.  
  25.     /*
  26.      * OUTPUT
  27.      */
  28.     cout << endl;
  29.     cout << "ERGEBNIS" << endl;
  30.     cout << "Summe: " << f_zahl_1 + f_zahl_2 << endl;
  31.     cout << "Differenz: " << f_zahl_1 - f_zahl_2 << endl;
  32.     cout << "Produkt: " << f_zahl_1 * f_zahl_2 << endl;
  33.     cout << "Quotient: " << f_zahl_1 / f_zahl_2 << endl;
  34.  
  35.     /*
  36.      * END OF PROGRAM
  37.      */
  38.     getchar();
  39.     getchar();
  40.     return (0);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement