Here's this code:
for i:= 1 to n
do Write(a[i]:6:2);
Writeln;
For loop outputs data from array..
Please, help - What does :6:2 in Write() mean?
Thanks in advance!
The spec x:n:m means a field width of n and m decimal places. It will be formatted as a real. If x=17.8 then x:6:2 comes out as " 17.80". Note that it is one leading space and that it is right justified. If m is 0 then no decimal point and no trailing digits. If you have x:n as the format you get scientific notation in a field width of n.
Also, n and m can be integer variables, so the field widths and decimal points can be changed during execution.