Browse Source

add Power

main
fdai7615 2 years ago
parent
commit
21014a487c
  1. 7
      src/funktion.c
  2. 1
      src/funktion.h
  3. 10
      src/main.c

7
src/funktion.c

@ -388,3 +388,10 @@ double work(double a, double d,double m)
{
return (m * a) * d;
}
double power(double a, double m, double d, double t)
{
double result;
result = ((m * a) * d) / t;
printf("%f", result);
return result;
}

1
src/funktion.h

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

10
src/main.c

@ -319,4 +319,14 @@ int main()
m=getValue('M');
d=getValue('D');
work(a, d, m);
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');
printf("Gib die Zeit t ein: ");
t=getValue('T');
power(a,m,d,t);
}
Loading…
Cancel
Save