Program dec2hex;

const hexidec : array[0..15] of char='0123456789ABCDEF';
type str2 = string[2];

Function Hex(mynum : byte) : str2;
 var value1, value3 : real;
     value2         : integer;
     dummy          : str2;

begin
 value1:=mynum/16;
 value2:=trunc(value1);
 dummy:=hexidec[value2];
 value3:=value1-value2;
 value3:=value3*16;
 value2:=trunc(value3);
 dummy:=dummy+hexidec[value2];
 hex:=dummy;
end;

var count : byte;

begin
 for count:=0 to 255 do
  write(' ',hex(count));
end.
