Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
quadratic equation
program quadratic equation; var a,b,c,d; integer; begin writeln('solving Quadratic Equation'); write(enter first coefficient (A, B, C): '); readln(a,b,c); d :-b*b - 4*a*c; if a - 0 then writeln('this is not a quadratic equation.') else if d < 0 then writeln('no real roots.') else if d - 0 then writeln('double roots. x - ', ((-b + sqrt(d)) / (2*a)):5:2) else {d > 0, two real roots} writeln('Two real roots x = ', (-b + sqrt(d)) / (2*a)):5:2, ', ',(-b - sqrt(d) /(2*a):5:2); end.
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
0
Tugas2
Huong11a2@
Tugas1
uuu
JONES
Zadanie 3 в
1
practica 1 ejercicio 8
1
Please log in to post a comment.