Browse Source

add Work

main
fdai7615 2 years ago
parent
commit
cbe8da5f3b
  1. 8
      src/funktion.c
  2. 1
      src/funktion.h
  3. 8
      src/main.c

8
src/funktion.c

@ -383,4 +383,12 @@ double position(double x0, double v0, double a, double t)
double force(double m, double a)
{
return m * a;
}
double work(double a, double d,double m)
{
double result;
result = (m * a) * d;
printf("%f", result);
return result;
}

1
src/funktion.h

@ -69,5 +69,6 @@ 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);
double work(double a, double d,double m) ;
#endif

8
src/main.c

@ -314,4 +314,12 @@ int main()
m=getValue('M');
a=getValue('A');
force(m, a);
printf("Gib die Beschleunigung a ein: ");
a=getValue('A');
printf("Gib die Masse m ein: ");
m=getValue('M');
printf("Gib die Strecke d ein: ");
d=getValue('D');
work(a, d, m);
}
Loading…
Cancel
Save