home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Education Master 1994 (4th Edition)
/
EDUCATIONS_MASTER_4TH_EDITION.bin
/
files
/
progscal
/
ptutor2b
/
recurson.pas
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
409 b
|
18 lines
(* Chapter 5 - Program 7 *)
program Try_Recursion;
var Count : integer;
procedure Print_And_Decrement(Index : integer);
begin
Writeln('The value of the index is ',Index:3);
Index := Index - 1;
if Index > 0 then
Print_And_Decrement(Index);
end;
begin (* main program *)
Count := 7;
Print_And_Decrement(Count);
end. (* main program *)