8
Pascal 4.0 User’s Guide
2
Compiling the Program
Now compile the program with
pc
, the Pascal compiler, by typing at the
system prompt:
hostname% pc temp.p
Pascal names the compiled version of the program
a.out
by default.
program temperature(output) ;
{ Program to convert temperatures from
Fahrenheit to Celsius. }
const
MIN = 32 ;
MAX = 50 ;
CONVERT = 5 / 9 ;
var
fahren: integer ;
celsius: real ;
begin
writeln('Fahrenheit
Celsius') ;
writeln('----------
-------') ;
for fahren := MIN to MAX do begin
celsius := CONVERT * (fahren - 32) ;
writeln(fahren: 5, celsius: 18: 2) ;
end ;
end.
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......