Flowchart (ISO 5807)
Source code
Pascal
function sumEven(n: integer): integer;
var i, s: integer;
begin
s := 0;
for i := 1 to n do
if i mod 2 = 0 then
s := s + i;
sumEven := s;
end;The editor opens with this code — change it and the chart redraws.
- Language
- Pascal
- Constructs
- evens up to n
- Topic
- Loops
- Formats
- Word, Visio, draw.io, PDF, SVG