Skip to content

Solving a linear equation

Pascal if / else if / else

Flowchart (ISO 5807)

YesNoYesNoStartInput a, ba ≠ 0Output −b / ab = 0Output «безліч розв», «язків»Output «немає розв», «язків»EndFigure 1 — solveLinear

Source code

Pascal
procedure solveLinear(a, b: real);
begin
  if a <> 0 then
    writeln(-b / a)
  else if b = 0 then
    writeln('безліч розв''язків')
  else
    writeln('немає розв''язків');
end;

The editor opens with this code — change it and the chart redraws.

Language
Pascal
Constructs
if / else if / else
Topic
Branching
Formats
Word, Visio, draw.io, PDF, SVG

Related examples