fork(4) download
  1. /*************************************************************************
  2. H e i n r i c h - H e r t z - E u r o p a k o l l e g , B o n n
  3. Autor: Ulrich Krumpen
  4. Klasse: IS315
  5. Datum: 26.10.2015
  6. Datei: zahlenvergleich.cpp
  7. Beschreibung: Zahlen vergleichen
  8. Modifikation: Rev. 3
  9. *************************************************************************/
  10.  
  11. #include <iostream>
  12. using namespace std;
  13.  
  14. int main (void)
  15. {
  16.  
  17. {
  18. system ("cls");
  19. cout << "Bitte geben Sie eine Zahl ein: "; // bittet den User um eine Zahl
  20. int x = 0;
  21. cin >> x; // liest Zahl von Konsole ein und speichert sie im int x
  22. cout << "Sie haben als erste Zahl " << x << "eingegeben" << endl;
  23. }
  24. {
  25. cout << "Bitte geben Sie eine weitere Zahl ein: "; // bittet den User um eine Zahl
  26. int y = 0;
  27. cin >> y; // liest Zahl von Konsole ein und speichert sie im int y
  28. cout << "Sie haben als zweite Zahl " << y << "eingegeben" << endl;
  29. return 0;
  30. }
  31. {
  32.  
  33. if(x==y) // Sind int x, die erste Zahl und int y, die zweite Zahl, gleich gross?
  34. {
  35. cout << "Die erste Zahl ist gleich der zweiten Zahl." << endl;
  36. }
  37.  
  38. else
  39. if(x<y) // Ist int x, die erste Zahl, kleiner als int y, die zweite Zahl?
  40. {
  41. cout <<"Die erste Zahl ist kleiner als die zweite Zahl." <<endl;
  42. }
  43.  
  44. else
  45. if(x>y) // Ist int x, die erste Zahl, groesser als int y, die zweite Zahl
  46. {
  47. cout <<"Die erste Zahl ist groesser als die zweite Zahl." <<endl;
  48. }
  49.  
  50.  
  51. }
  52. cout << "Danke fuer Ihr Mitwirken." <<endl;
  53. system ("pause");
  54. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:33:12: error: 'x' was not declared in this scope
         if(x==y) // Sind int x, die erste Zahl und int y, die zweite Zahl, gleich gross?
            ^
prog.cpp:33:15: error: 'y' was not declared in this scope
         if(x==y) // Sind int x, die erste Zahl und int y, die zweite Zahl, gleich gross?
               ^
stdout
Standard output is empty