From 0ec1ec8c3593e00674eb8e5823c815a2347bb099 Mon Sep 17 00:00:00 2001 From: Fdai7396 Date: Tue, 7 Feb 2023 18:44:05 +0100 Subject: [PATCH] add dreieckUmfang --- src/funktion.c | 3 +++ src/funktion.h | 1 + src/main.c | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/src/funktion.c b/src/funktion.c index 15436ad..88ea51e 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -327,4 +327,7 @@ double kreisUmfang(double r) { double dreieckFlaeche(double a, double b, double c) { double s = (a + b + c) / 2; return sqrt(s * (s - a) * (s - b) * (s - c)); +} +double dreieckUmfangn(double a, double b, double c) { + return a + b + c; } \ No newline at end of file diff --git a/src/funktion.h b/src/funktion.h index 5b06b9a..cab2fed 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -56,5 +56,6 @@ double grundwert(double ein, double prozent); double kreisFlaeche(double r); double kreisUmfang(double r); double dreieckFlaeche(double a, double b, double c); +double dreieckUmfangn(double a, double b, double c); #endif diff --git a/src/main.c b/src/main.c index ea6fb21..8b51d38 100644 --- a/src/main.c +++ b/src/main.c @@ -253,4 +253,10 @@ int main() b = getValue('b'); c = getValue('c'); dreieckFlaeche(a,b,c); + + a = getValue('a'); + b = getValue('b'); + c = getValue('c'); + dreieckUmfangn(a,b,c); + printf("Der Umfang des Dreiecks betraegt: %f\n", a + b + c); }