diff --git a/src/funktion.c b/src/funktion.c index 57bfdf9..85978a8 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -333,4 +333,7 @@ double dreieckUmfangn(double a, double b, double c) { } double viereckFlaeche(double a, double b) { return a * b; +} +double viereckUmfang(double a, double b){ + return (2 * a) + (2 * b); } \ No newline at end of file diff --git a/src/funktion.h b/src/funktion.h index a462b49..36467ba 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -58,5 +58,6 @@ double kreisUmfang(double r); 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); #endif diff --git a/src/main.c b/src/main.c index 3c2513f..d95dd59 100644 --- a/src/main.c +++ b/src/main.c @@ -262,4 +262,9 @@ int main() a = getValue('a'); b = getValue('b'); viereckFlaeche(a,b); + + a = getValue('a'); + b = getValue('b'); + viereckUmfang(a,b); + printf("Der Umfang des Vierecks betraegt: %lf\n", (2 * a) + (2 * b)); }