\(\displaystyle{ d=\frac{c^2 - a^2 - b^2 }{ 2b}}\)
pomoze ktos zrobic program ktory ta funkcje obliczy??
mam cos takiego juz zrobione gdzie tu blad??
Kod: Zaznacz cały
#include <stdio.h>
#include <math.h>
float d(float a,float b, float c)
{
if(a<=0 || b<=0 || c<=0)
return (printf("Bledne dane!
"));
else return c*c-a*a-b*b/2b;
}
main()
{
printf("Program obliczajacy wartosc d w trojkacie ostrokatnym
");
float a,b,c;
printf("Podaj wspolczynnik a : ");
scanf("%f",&a);
printf("Podaj wspolczynnik b : ");
scanf("%f",&b);
printf("Podaj wspolczynnik c : ");
scanf("%f",&c);
return 1;
}