|
more than 450 programs for free
|
![]() English |
![]() Slovensky |
![]() Česky |
![]() Šarišsky |
Non-conditioned cycle FOR (cylewith ended line of cycling)
FOR I:=X TO Y DO BEGIN
command; .. END; Cycle for is good for multi number cycling of one ore more commands. For making of cycle is required a controlling variable - COUNTER (i). Atn the begin we tell to a program from what kind of a number it will start to cycling.( X variable). At every cycle it will to counter get +1. If counter = the ending number (Y variable) cycle is ending.
for i:=1 to 10 do begin
WriteLn ('I=‘,i); end; It will write number from 1 to 10. <<Previous | Content | Next>> |
|