program quadratic_equations; uses crt; var x1,x2,a,b,c:real; begin textcolor(red); textbackground(green); writeln('Hello! This is a program that can solve quadratic equations'); writeln; writeln; writeln('Write the A please'); readln(a); writeln('Write the B please'); readln(b); writeln('Write the C please'); readln(c); writeln;writeln;x1:=(-b+sqrt(sqr(b)-(4*a*c)))/(2 * a); x2:=(-b-sqrt(sqr(b)-(4*a*c)))/(2 * a); textbackground(brown); textcolor(white); writeln('X1 is equal to: ',x1:2:2,' And X2 is equal to: ',x2:2:2); readln; end.
|