HP SunSoft Pascal 4.0 Bedienungsanleitung Seite 32

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 333
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 31
8 Pascal 4.0 Users 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.
Seitenansicht 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 ... 332 333

Kommentare zu diesen Handbüchern

Keine Kommentare