You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
450 B

  1. #include <stdio.h>
  2. #include "minirechner.h"
  3. //addieren
  4. float addieren(float a, float b) {
  5. return a + b;
  6. }
  7. //subtrahieren
  8. float subtrahieren(float a, float b) {
  9. return a - b;
  10. }
  11. //multiplizieren
  12. float multiplizieren(float a, float b) {
  13. return a * b;
  14. }
  15. //dividieren
  16. float dividieren(float a, float b) {
  17. if (b == 0) {
  18. printf("Bitte nicht durch 0 dividieren\n");
  19. return 0;
  20. }
  21. else {
  22. return a / b;
  23. }
  24. }