fork(1) download
  1. #include<stdio.h>
  2. #include<math.h>
  3.  
  4. void text(void)
  5. {
  6. printf("Bitte gib Fall ein\n");
  7. }
  8.  
  9. void textfall(void)
  10. {
  11. printf("Bitte gib Zahl ein\n");
  12. }
  13.  
  14. float Rechnung1(float a, float b)
  15. {
  16. return (a * b);
  17.  
  18. }
  19.  
  20. float Rechnung2(float a, float b)
  21. {
  22. return (a / b);
  23. }
  24.  
  25. int main()
  26. {
  27. int Fall;
  28. float ergebnis1 = Rechnung1(x,y);
  29. float ergebnis2 = Rechnung2(x,y);
  30. text();
  31. scanf_s("%i", &Fall);
  32.  
  33. switch (Fall)
  34. {
  35.  
  36. case 1:
  37. textfall();
  38. scanf_s("%f", &x);
  39. textfall();
  40. scanf_s("%f", &y);
  41. Rechnung1(x, y);
  42. printf("Die Anwort heißt: %f \n",ergebnis1);
  43. break;
  44. case 2:
  45. textfall();
  46. scanf_s("%f", &x);
  47. textfall();
  48. scanf_s("%f", &y);
  49. Rechnung2(x,y);
  50. printf("Die Anwort heißt: %f \n", ergebnis2);
  51. break;
  52.  
  53. }
  54.  
  55.  
  56. return 0;
  57. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:28:29: error: ‘x’ undeclared (first use in this function)
 float ergebnis1 = Rechnung1(x,y);
                             ^
prog.c:28:29: note: each undeclared identifier is reported only once for each function it appears in
prog.c:28:31: error: ‘y’ undeclared (first use in this function)
 float ergebnis1 = Rechnung1(x,y);
                               ^
prog.c:31:1: warning: implicit declaration of function ‘scanf_s’; did you mean ‘scanf’? [-Wimplicit-function-declaration]
 scanf_s("%i", &Fall);
 ^~~~~~~
 scanf
stdout
Standard output is empty