Structured program theorem: Difference between revisions

Content deleted Content added
No edit summary
Line 30:
 
<source lang="pascal">
p := 1;
while p > 0 do begin
if p = 1 then begin
perform step 1 from the flowchart;
p := resulting successor step number of step 1 from the flowchart (0 if no successor);
end; if
if p = 2 then begin
perform step 2 from the flowchart;
p := resulting successor step number of step 2 from the flowchart (0 if no successor);
end; if
...
if p = n then begin
perform step n from the flowchart;
p := resulting successor step number of step n from the flowchart (0 if no successor);
end; if
end. while
</source>