put "Fahrenheit Celcius" var fahr: int var cel: real for i: -2..10 fahr := i * 10 cel := (fahr - 32) * 5/9 put fahr, " ", cel end for
const fahr2cel_add : int := -32 const fahr2cel_mul : real := 5/9 put "Fahrenheit Celcius" put "---------- -------" for i: -2..10 var cel : real % must be real var fahr : real % make it real for matching format fahr := i* 10 % to give the specified intervals cel := (fahr+fahr2cel_add)*fahr2cel_mul % the conversion put fahr:7:1, cel:10:1 % #'s after : are for formatting end for
put "Fahrenheit Celcius" put "---------- -------" for i: -2..10 put i*10.0:7:1,(i*10-32)*0.5556:10:1 end for