Browse Source

add trapezUmfange

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

3
src/funktion.c

@ -337,3 +337,6 @@ double viereckFlaeche(double a, double b) {
double viereckUmfang(double a, double b){ double viereckUmfang(double a, double b){
return (2 * a) + (2 * b); return (2 * a) + (2 * b);
} }
double trapezUmfang(double a, double b, double h) {
return (2 * h) + a + b;
}

1
src/funktion.h

@ -59,5 +59,6 @@ double dreieckFlaeche(double a, double b, double c);
double dreieckUmfangn(double a, double b, double c); double dreieckUmfangn(double a, double b, double c);
double viereckFlaeche(double a, double b); double viereckFlaeche(double a, double b);
double viereckUmfang(double a, double b); double viereckUmfang(double a, double b);
double trapezUmfang(double a, double b, double h);
#endif #endif

6
src/main.c

@ -266,4 +266,10 @@ int main()
a = getValue('a'); a = getValue('a');
b = getValue('b'); b = getValue('b');
viereckUmfang(a,b); viereckUmfang(a,b);
a = getValue('a');
b = getValue('b');
h = getValue('h');
trapezUmfang(a,b,h);
printf("Der Umfang des Trapezes betraegt: %lf\n", (2 * h) + a + b);
} }
Loading…
Cancel
Save