@ -323,4 +323,8 @@ double kreisFlaeche(double r) {
}
double kreisUmfang(double r) {
return 2 * M_PI * r;
double dreieckFlaeche(double a, double b, double c) {
double s = (a + b + c) / 2;
return sqrt(s * (s - a) * (s - b) * (s - c));
@ -55,5 +55,6 @@ double prozentsatz(double ein, double prozent);
double grundwert(double ein, double prozent);
double kreisFlaeche(double r);
double kreisUmfang(double r);
double dreieckFlaeche(double a, double b, double c);
#endif
@ -248,4 +248,11 @@ int main()
r = getValue('r');
kreisUmfang(r);
a = getValue('a');
b = getValue('b');
c = getValue('c');
dreieckFlaeche(a,b,c);
printf("Die Flaeche des Dreiecks betraegt: %f\n", sqrt(s * (s - a) * (s - b) * (s - c)));