Question: Procedure to find roots of a second degree equation

I'm new to programming.

I don't understand what I'm doing wrong in this


quad:=proc(a,b,c)
local det;
det:=b^2-4*a*c;
if (a=0,b=0,c=0) then print( "All x is solution")
 elif (a=0,b=0,c<>0) then print ("No solution")
 elif (a=0,b<>0,c<>0) then print("One solution:"x=-c/b)
 elif (det>0) then print("Two real solutions:"x1=(-b+sqrt(det))/(2*a),x2=(-b-sqrt(det))/(2*a))
 elif (det<0) then print("Two complex solutions:"x1=(-b+sqrt(det))/(2*a),x2=(-b-sqrt(det))/(2*a))
 else print("Two identical solutions:"x=-b/(2*a))
end if;
end proc;

I get this message: Error, missing operator or `;`

If you have any comment/idea to make the proc better, let me know please .

thanks.

Please Wait...