///Author: Karara Mohamed @ tutodev1.blogspot.com/
#include <stdio.h>
#include <stdlib.h>
void equ(float a,float b,float c){
float delta;
printf ("entrez a :",a);
scanf("%f",&a);
printf ("entrez b :",b);
scanf("%f",&b);
printf ("entrez c :",c);
scanf("%f",&c);
delta= (b*b - 4*a*c);
printf("delta est %.2f\n",delta);
if(((a==0)&&((b==0))||(c==0)))
{
printf("la solition est IR\n");
}
else
if (a==0)
{
printf("la solution est :%f\n",-c / b);
}
else if (delta < 0 )
{
printf (" PAS DE SOLUTION dans IR\n");
}
else if (delta==0)
{
printf (" x = %0.2f\n", b*b/(2*a));
}
else
{
printf (" a comme racines X1 =%0.2f et X2=%0.2f\n",(-b -sqrt(delta))/(2*a),(-b +sqrt(delta))/(2*a));
}
}
int main(int argc, char *argv[])
{ float x,y,z;
equ(x,y,z);
system("PAUSE");
return 0;
}