You are on page 1of 1

KODI:

#include <stdio.h>
#include <math.h>

int main()
{
double a, b, c, D, x1, x2;

printf("Jepni koeficientet a, b, c: \n");


scanf("%lf %lf %lf",&a, &b, &c);
printf("\n\nZgjidhjet jane:\n");
D = b*b-4*a*c;
if (D > 0)
{
x1 = (-b+sqrt(D))/(2*a);
x2 = (-b-sqrt(D))/(2*a);

printf("x1 = %.2lf and x2 = %.2lf\n",x1 , x2);


}

else if (D == 0)
{
x1 = x2 = -b/(2*a);

printf("x1 = x2 = %.2lf;\n", x1);


}

else
{
printf("Ekuacioni nuk ka zgjidhje ne R");
}

return 0;
}