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

Published on 12 May 2024 09:40 PM

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

Source code in the cobol programming language

       identification division.
       program-id. character-codes.
       remarks. COBOL is an ordinal language, first is 1.
       remarks. 42nd ASCII code is ")" not, "*".
       procedure division.
       display function char(42)
       display function ord('*')
       goback.
       end program character-codes.


  

You may also check:How to resolve the algorithm Remove duplicate elements step by step in the Elena programming language
You may also check:How to resolve the algorithm Hickerson series of almost integers step by step in the TI-83 BASIC programming language
You may also check:How to resolve the algorithm Chowla numbers step by step in the PowerBASIC programming language
You may also check:How to resolve the algorithm Fractal tree step by step in the Standard ML programming language
You may also check:How to resolve the algorithm CRC-32 step by step in the Crystal programming language