Browse Source

add dreieckUmfang

main
Fdai7396 2 years ago
parent
commit
0ec1ec8c35
  1. 3
      src/funktion.c
  2. 1
      src/funktion.h
  3. 6
      src/main.c

3
src/funktion.c

@ -328,3 +328,6 @@ 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;
}

1
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

6
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);
}
Loading…
Cancel
Save