diff --git a/src/funktion.c b/src/funktion.c index 814bb06..f2df238 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -379,4 +379,11 @@ double velocity(double v0, double a, double t) double position(double x0, double v0, double a, double t) { return x0 + v0 * t + 0.5 * a * t * t; +} +double force(double m, double a) +{ + double result; + result = m * a; + printf("%f", result); + return result; } \ No newline at end of file diff --git a/src/funktion.h b/src/funktion.h index 3d02d4b..0aca77e 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -68,5 +68,6 @@ double substraction_2Zahlen(double sZahl1,double sZahl2); double substraction_3Zahlen(double sZahl1,double sZahl2,double sZahl3); double velocity(double v0, double a, double t); double position(double x0, double v0, double a, double t); +double force(double m, double a); #endif diff --git a/src/main.c b/src/main.c index 8aa9dcd..16ec372 100644 --- a/src/main.c +++ b/src/main.c @@ -310,4 +310,10 @@ int main() a=getValue('A'); t=getValue('T'); position(x0, v0, a, t); + + printf("Gib die Masse m ein: "); + m=getValue('M'); + printf("Gib die Beschleunigung a ein: "); + a=getValue('A'); + force(m, a); }