program enumerated4 (input,output);

 

type MonthAbbrev = (jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec);

     MonthNumber = 1..12;

 

var month : MonthAbbrev;

    monNum : MonthNumber;

  

begin

    monNum := ord(mar);

    writeln (' the number of the month March is ',  monNum);

    for month := jan to dec do

        write (ord(month),' ');

    writeln;

    writeln (' monNum is a subrange of integers from 1..12 ');

    monNum := 1;

    while (monNum <= 12) do

       begin

         write (monNum, ' ');

         monNum := succ(monNum);

       end;   

    writeln () ;

    writeln('  trying to excede the range of MonthNumber and printout -3 to -14 ');

    for monNum := -3 to 14 do

      write (monNum, ' ');

    writeln;

    writeln (' what if I try 1 to 14 ');

    for monNum := 1 to 14 do

      write  (monNum, ' ');

       writeln (' after the loop has ended, monNum is ', monNum);

    writeln;

end.