diff --git a/src/funktion.c b/src/funktion.c index 85978a8..46450e1 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -336,4 +336,7 @@ double viereckFlaeche(double a, double b) { } double viereckUmfang(double a, double b){ return (2 * a) + (2 * b); +} +double trapezUmfang(double a, double b, double h) { + return (2 * h) + a + b; } \ No newline at end of file diff --git a/src/funktion.h b/src/funktion.h index 36467ba..676a0b4 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -59,5 +59,6 @@ double dreieckFlaeche(double a, double b, double c); double dreieckUmfangn(double a, double b, double c); double viereckFlaeche(double a, double b); double viereckUmfang(double a, double b); +double trapezUmfang(double a, double b, double h); #endif diff --git a/src/main.c b/src/main.c index 07936aa..37a364a 100644 --- a/src/main.c +++ b/src/main.c @@ -266,4 +266,10 @@ int main() a = getValue('a'); b = getValue('b'); viereckUmfang(a,b); + + a = getValue('a'); + b = getValue('b'); + h = getValue('h'); + trapezUmfang(a,b,h); + printf("Der Umfang des Trapezes betraegt: %lf\n", (2 * h) + a + b); }