Flowchart (ISO 5807)
Source code
Pascal
procedure Solve(a, b, c: real);
var d, x1, x2: real;
begin
d := b * b - 4 * a * c;
if d > 0 then
begin
x1 := (-b + sqrt(d)) / (2 * a);
x2 := (-b - sqrt(d)) / (2 * a);
writeln('x1=', x1, ' x2=', x2);
end
else if d = 0 then
writeln('x=', -b / (2 * a))
else
writeln('Дійсних коренів немає');
end;The editor opens with this code — change it and the chart redraws.
- Language
- Pascal
- Constructs
- discriminant, if / else
- Topic
- Branching
- Formats
- Word, Visio, draw.io, PDF, SVG