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); }