Algol 60 Sample Program
Posted on by admin


Algol Pascal
Algol 60 was the first structured containing blocks whose range defined the of variables, i.e. The variables declared within the block was accessible for code statements within that block only:begin integer A, X; comment outer X;A:= 3;X:= 5;begin integer X, Y; comment inner X;X:= 4; comment inner X assigned here;Y:= 8;endprint (X); comment prints '5', not '4' since this is outer scope;Y:= 12; comment illegal! Y not defined in outer scope;end;This kind of declaration scope was introduced with Algol 60, and soon became the programming language standard of the many programming languages in the Algol class. Notable exception was, introduced after Algol, yet having no declaration scope.