Find limit of recursion is part of Short Circuit's Console Program Basics selection.
Task

Find the limit of recursion.




 
recurs: proc options (main) reorder;
dcl sysprint file;
dcl mod      builtin;
 
dcl ri       fixed bin(31) init (0);
 
recursive: proc recursive;            
  ri += 1;
  if mod(ri, 1024) = 1 then
    put data(ri);
 
  call recursive();
end recursive;
 
call recursive();
end recurs;
 