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.
28 lines
450 B
28 lines
450 B
#include <stdio.h>
|
|
#include "minirechner.h"
|
|
|
|
//addieren
|
|
float addieren(float a, float b) {
|
|
return a + b;
|
|
}
|
|
|
|
//subtrahieren
|
|
float subtrahieren(float a, float b) {
|
|
return a - b;
|
|
}
|
|
|
|
//multiplizieren
|
|
float multiplizieren(float a, float b) {
|
|
return a * b;
|
|
}
|
|
|
|
//dividieren
|
|
float dividieren(float a, float b) {
|
|
if (b == 0) {
|
|
printf("Bitte nicht durch 0 dividieren\n");
|
|
return 0;
|
|
}
|
|
else {
|
|
return a / b;
|
|
}
|
|
}
|