How to resolve the algorithm Character codes step by step in the Erlang programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Character codes step by step in the Erlang 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 Erlang programming language

Source code in the erlang programming language

1> F = fun([X]) -> X end. 
#Fun<erl_eval.6.13229925>
2> F("a").
97


3> $a.
97


  

You may also check:How to resolve the algorithm Word wrap step by step in the Lingo programming language
You may also check:How to resolve the algorithm Ackermann function step by step in the Component Pascal programming language
You may also check:How to resolve the algorithm Matrix-exponentiation operator step by step in the C++ programming language
You may also check:How to resolve the algorithm Multifactorial step by step in the RPL programming language
You may also check:How to resolve the algorithm 99 bottles of beer step by step in the Comal programming language