How to resolve the algorithm Character codes step by step in the Oberon-2 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Character codes step by step in the Oberon-2 programming language

Table of Contents

Problem Statement

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

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.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Character codes step by step in the Oberon-2 programming language

Source code in the oberon-2 programming language

MODULE Ascii;
IMPORT Out;
VAR
	c: CHAR;
	d: INTEGER;
BEGIN
	c := CHR(97);
	d := ORD("a");
	Out.Int(d,3);Out.Ln;
	Out.Char(c);Out.Ln
END Ascii.

  

You may also check:How to resolve the algorithm Program name step by step in the C# programming language
You may also check:How to resolve the algorithm Knapsack problem/Continuous step by step in the Julia programming language
You may also check:How to resolve the algorithm Loops/For step by step in the Verilog programming language
You may also check:How to resolve the algorithm Range expansion step by step in the Lingo programming language
You may also check:How to resolve the algorithm Towers of Hanoi step by step in the CLU programming language