Daffodil International University
Problem Link
//Please follow from main function
#include <stdio.h>
#include <stdlib.h>
int main()
{
double a, b, c, d, r1, r2;
scanf("%lf %lf %lf", &a, &b, &c);
d=(b*b)-(4*a*c);
r1=(-b+sqrt(d))/(2*a);
r2=(-b-sqrt(d))/(2*a);
if(a!=0 && d>0)
{
printf("R1 = %.5lf\nR2 = %.5lf\n", r1, r2);
}
else
{
printf("Impossivel calcular\n");
}
return 0;
}
0 Comments