Multiplication tables: Difference between revisions

m
Line 1,790:
END
</lang>Based on the above code but with a slight modification as VAX FORTRAN doesn't allow zero width fields in a format statement. The number of rows and columns can also be altered by modifying the value of K which must be in the range 1 - 25.
===FORTRAN-IV===<lang Fortran> PROGRAM TABLES
<lang Fortran> PROGRAM TABLES
C
C Produce a formatted multiplication table of the kind memorised by rote
Line 1,827 ⟶ 1,828:
C
END</lang>Rather more changes are needed to produce the same result, in particular we cannot modify the format specifier directly and have to rely on overlaying it with an integer array and calculating the ASCII values needed for each byte we need to modify. Nested implicit DO loops are allowed, but not used as it isn't possible to compute K on the fly so we have to calculate (and store) the results for each row before printing it. Note also that the unit numbers for the output devices are different and when using Hollerith strings to define values in a DATA statement the size of each string must match the size of the data type.
 
===Microsoft FORTRAN-80===
The use of a non standard(?) BYTE data type available in Microsoft FORTRAN-80 makes it easier to understand what is going on.
Anonymous user