How to resolve the algorithm Create a two-dimensional array at runtime step by step in the ERRE programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Create a two-dimensional array at runtime step by step in the ERRE programming language

Table of Contents

Problem Statement

Get two integers from the user, then create a two-dimensional array where the two dimensions have the sizes given by those numbers, and which can be accessed in the most natural way possible. Write some element of that array, and then output that element. Finally destroy the array if not done by the language itself.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Create a two-dimensional array at runtime step by step in the ERRE programming language

Source code in the erre programming language

PROGRAM DYNAMIC

!$DYNAMIC
DIM A%[0,0]

BEGIN
  PRINT(CHR$(12);) !CLS
  INPUT("Subscripts",R%,C%)
  !$DIM A%[R%,C%]
  A%[2,3]=6
  PRINT("Value in row";2;"and col";3;"is";A%[2,3])
END PROGRAM


  

You may also check:How to resolve the algorithm Day of the week step by step in the Factor programming language
You may also check:How to resolve the algorithm Terminal control/Clear the screen step by step in the Euphoria programming language
You may also check:How to resolve the algorithm Nth root step by step in the XPL0 programming language
You may also check:How to resolve the algorithm Longest common substring step by step in the Action! programming language
You may also check:How to resolve the algorithm Earliest difference between prime gaps step by step in the Julia programming language