BSD 1 development
[unix-history] / tests / numericIO.p
CommitLineData
fde98a2d
BJ
1program numericIO(f,output);
2 const n = 500; d = 0.12345;
3 var i: integer; x,s: real;
4 f: file of real;
5begin writeln(clock);
6 x := 1.0; s := 0; rewrite(f);
7 for i := 1 to n do
8 begin write(f,x); s := s+x; x := x+d
9 end ;
10 writeln(clock, s);
11 reset(f); s := 0;
12 while not eof(f) do
13 begin read(f,x); s := s+x
14 end ;
15 writeln(clock, s)
16end .