program FindRoots; var a, b, c: integer; D: integer; x1, x2: real; begin a := 3; b := 2; c := -4;
D := b b - 4 a * c;
if D > 0 then begin x1 := −b+sqrt(D)-b + sqrt(D)−b+sqrt(D) / 2<em>a2 <em> a2<em>a; x2 := −b−sqrt(D)-b - sqrt(D)−b−sqrt(D) / 2</em>a2 </em> a2</em>a; writeln′Therootsare:x1=′,x1:0:2,′andx2=′,x2:0:2'The roots are: x1 = ', x1:0:2, ' and x2 = ', x2:0:2′Therootsare:x1=′,x1:0:2,′andx2=′,x2:0:2; end else if D = 0 then begin x1 := -b / 2∗a2 * a2∗a; writeln′Therootis:x=′,x1:0:2'The root is: x = ', x1:0:2′Therootis:x=′,x1:0:2; end else writeln′Theequationhasnorealroots.′'The equation has no real roots.'′Theequationhasnorealroots.′; end.
program FindRoots;
var
a, b, c: integer;
D: integer;
x1, x2: real;
begin
a := 3;
b := 2;
c := -4;
D := b b - 4 a * c;
if D > 0 then
begin
x1 := −b+sqrt(D)-b + sqrt(D)−b+sqrt(D) / 2<em>a2 <em> a2<em>a;
x2 := −b−sqrt(D)-b - sqrt(D)−b−sqrt(D) / 2</em>a2 </em> a2</em>a;
writeln′Therootsare:x1=′,x1:0:2,′andx2=′,x2:0:2'The roots are: x1 = ', x1:0:2, ' and x2 = ', x2:0:2′Therootsare:x1=′,x1:0:2,′andx2=′,x2:0:2;
end
else if D = 0 then
begin
x1 := -b / 2∗a2 * a2∗a;
writeln′Therootis:x=′,x1:0:2'The root is: x = ', x1:0:2′Therootis:x=′,x1:0:2;
end
else
writeln′Theequationhasnorealroots.′'The equation has no real roots.'′Theequationhasnorealroots.′;
end.