(* Name: Kwan Hei Ching *) (* Class: 5E(19) *) (* Objective: To find the root of a quadratic equation *) program Noname1(input,output); var a, b, c, d, root1,root2: real; begin repeat Write('input a : '); readln(a); if a=0 then begin writeln('Input something not = 0!'); end; until a <> 0 ; Write('input b : '); Readln(b); Write('input c : '); readln(c); d := (b*b) - (4 * a * c); if d<0 then begin writeln('The equation has no real root.'); end else if d= 0 then begin writeln('The equation has one real root.'); root1 := (-b + (sqrt(b*b-4*a*c))) / (2*a); write(root1:0:2); end else if d>0 then begin writeln('The equation has two real roots.'); root1 := (-b + (sqrt(b*b-4*a*c))) / (2*a); root2 := (-b - (sqrt(b*b-4*a*c))) / (2*a) ; write(root1:0:2,' ',root2:0:2); end ; readln; end.