Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program QuadraticEquationSolver;
- var
- a : real;
- b : real;
- c : real;
- x1 : real = 0;
- x2 : real = 0;
- begin
- writeln('Enter the coefficient of a: ');
- readln(a);
- writeln('Enter the coefficient of b: ');
- readln(b);
- writeln('Enter the coefficient of c: ');
- readln(c);
- x1 := (-b + sqrt((b*b) - 4*a*c)) / (2 * a);
- x2 := (-b - sqrt((b*b) - 4*a*c)) / (2 * a);
- writeln('The value of x1 is: ');
- write(x1);
- writeln('The value of x2 is: ');
- write(x2);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement