From 3e45f26657891a8462ced6d2f3274498a9f6713f Mon Sep 17 00:00:00 2001 From: fdai7615 Date: Wed, 8 Feb 2023 00:36:39 +0100 Subject: [PATCH] add Flaeche --- src/funktion.c | 9 ++++++++- src/funktion.h | 1 + src/main.c | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/funktion.c b/src/funktion.c index 8a95af0..8b8624c 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -415,4 +415,11 @@ double Druck(double F, double A) double Kraft(double p,double A) { return p * A; -} \ No newline at end of file +} +double Flaeche(double F, double p) +{ + double A; + A = F / p; + printf("Flaeche (A) = %.2lf\n", A); + return A; +} diff --git a/src/funktion.h b/src/funktion.h index 9e2b642..ef8bcf1 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -77,5 +77,6 @@ double Eintauchtiefe(double ps,double pfi,double g); double Ortsfaktor(double ps,double pfi,double h); double Druck(double F, double A); double Kraft(double A,double p); +double Flaeche(double p, double F); #endif diff --git a/src/main.c b/src/main.c index bce5457..d001d85 100644 --- a/src/main.c +++ b/src/main.c @@ -353,4 +353,10 @@ int main() p=getValue('P'); A=getValue('A'); Kraft(p,A); + + printf("Geben Sie die Kraft (F) ein: "); + F=getValue('F'); + printf("Geben Sie den Druck (p) ein: "); + p=getValue('P'); + Flaeche(p,F); }