program QuadraticEquation; var a, b, c, D, x1, x2: real; begin writeln('Enter the coefficients of the quadratic equation:'); readln(a, b, c);
D := bb - 4a*c;
if D < 0 then writeln('The equation has no real roots') else if D = 0 then begin x1 := (-b + sqrt(D)) / (2a); writeln('The equation has one real root: x = ', x1); end else begin x1 := (-b + sqrt(D)) / (2a); x2 := (-b - sqrt(D)) / (2*a); writeln('The equation has two real roots: x1 = ', x1, ' and x2 = ', x2); end; end.
program QuadraticEquation;
var
a, b, c, D, x1, x2: real;
begin
writeln('Enter the coefficients of the quadratic equation:');
readln(a, b, c);
D := bb - 4a*c;
if D < 0 then
writeln('The equation has no real roots')
else if D = 0 then
begin
x1 := (-b + sqrt(D)) / (2a);
writeln('The equation has one real root: x = ', x1);
end
else
begin
x1 := (-b + sqrt(D)) / (2a);
x2 := (-b - sqrt(D)) / (2*a);
writeln('The equation has two real roots: x1 = ', x1, ' and x2 = ', x2);
end;
end.