

Task

Given a character value in your language, print its code   (could be ASCII code, Unicode code, or whatever your language uses).



Example

The character   'a'   (lowercase letter A)   has a code of 97 in ASCII   (as well as Unicode, as ASCII forms the beginning of Unicode).

Conversely, given a code, print out the corresponding character.




MODULE asc;
 
IMPORT  InOut;
 
VAR     letter          : CHAR;
        ascii           : CARDINAL;
 
BEGIN
  letter := 'a';
  InOut.Write (letter);
  ascii := ORD (letter);
  InOut.Write (11C);            (*  ASCII TAB   *)
  InOut.WriteCard (ascii, 8);
  ascii := ascii - ORD ('0');
  InOut.Write (11C);            (*  ASCII TAB   *)
  InOut.Write (CHR (ascii));
  InOut.WriteLn
END asc.