From ce23b7dba08c43860a89bcfd878df7091018334e Mon Sep 17 00:00:00 2001 From: Fdai7396 Date: Tue, 7 Feb 2023 18:48:07 +0100 Subject: [PATCH] add viereckFlaeche --- src/funktion.c | 3 +++ src/funktion.h | 1 + src/main.c | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/src/funktion.c b/src/funktion.c index 88ea51e..57bfdf9 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -330,4 +330,7 @@ double dreieckFlaeche(double a, double b, double c) { } double dreieckUmfangn(double a, double b, double c) { return a + b + c; +} +double viereckFlaeche(double a, double b) { + return a * b; } \ No newline at end of file diff --git a/src/funktion.h b/src/funktion.h index cab2fed..a462b49 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -57,5 +57,6 @@ double kreisFlaeche(double r); 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); #endif diff --git a/src/main.c b/src/main.c index 4d6cb2b..0643dd0 100644 --- a/src/main.c +++ b/src/main.c @@ -258,4 +258,9 @@ int main() b = getValue('b'); c = getValue('c'); dreieckUmfangn(a,b,c); + + a = getValue('a'); + b = getValue('b'); + viereckFlaeche(a,b); + printf("Der Flaecheninhalt des Vierecks betraegt: %lf\n", a * b); }