#include<stdio.h>
#include<math.h>
#include<conio.h>
float FGen1(float a, float b, float c);
float FGen2(float a, float b, float c);
int main()
{
float a, b, c, x1, x2;
printf("Introduce los valores (a,b,c)...\n");
scanf("%f,%f,%f",&a,&b,&c);
x1=FGen1(a,b,c);
x2=FGen2(a,b,c);
printf("FGen=%f\n",x1);
printf("FGen=%f\n",x2);
getch();
}
float FGen1(float a, float b, float c)
{
float x1;
x1=(-b+sqrt(pow(b,2)-(4*a*c)))/(2*a);
return x1;
}
float FGen2(float a, float b, float c)
{
float x2;
x2=(-b-sqrt(pow(b,2)-(4*a*c)))/(2*a);
return x2;
}
No hay comentarios:
Publicar un comentario