Flowchart (ISO 5807)
Source code
Pascal
function trapez(a, b: real; n: integer): real;
var h, s, x: real;
i: integer;
begin
h := (b - a) / n;
s := (a * a + b * b) / 2;
for i := 1 to n - 1 do
begin
x := a + i * h;
s := s + x * x;
end;
trapez := s * h;
end;The editor opens with this code — change it and the chart redraws.
- Language
- Pascal
- Constructs
- numeric integration
- Topic
- Algorithms
- Formats
- Word, Visio, draw.io, PDF, SVG