How to resolve the algorithm Multi-dimensional array step by step in the REXX programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Multi-dimensional array step by step in the REXX programming language

Table of Contents

Problem Statement

For the purposes of this task, the actual memory layout or access method of this data structure is not mandated. It is enough to:

Show all output here, (but you may judiciously use ellipses to shorten repetitive output text).

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Multi-dimensional array step by step in the REXX programming language

Source code in the rexx programming language

g = antenna.2.0


    a = '"'                    /*set variable  A  to a quote character  ["].  */
    b = '~'                    /*set variable  B  to a tilde character  [~].  */

h.a.b = '+++'                  /*set variable  H.".~  to three pluses  [+++]. */


/*REXX program shows how to  assign and/or display  values of a multi─dimensional array.*/
                                                 /*REXX arrays can start anywhere.      */
y.=0                                             /*set all values of   Y   array to  0. */
                                                 /* [↑]  bounds need not be specified.  */
#=0                                              /*the count for the number of   SAYs.  */
y.4.3.2.0= 3**7                                  /*set penultimate element to   2187    */
                      do       i=0  for 5
                        do     j=0  for 4
                          do   k=0  for 3
                            do m=0  for 2;   #=#+1             /*bump the  SAY  counter.*/
/*the 1st SAY──► */         say  'y.'i"."j'.'k"."m   '='   y.i.j.k.m
                            end   /*m*/
                          end     /*k*/
                        end       /*j*/
                      end         /*i*/
say
say '# of elements displayed = '  #              /*should be   5 * 4 * 3 * 2    or   5! */
exit                                             /*stick a fork in it,  we're all done. */

                   /* [↓]   other versions of the first (REXX)   SAY   instruction. */
                      say  'y.' || i || . || k || . || m  '='  y.i.j.k.m
                      say  'y.'||i||.||k||.||m            '='  y.i.j.k.m
                      say  'y.'i||.||k||.||m              '='  y.i.j.k.m


  

You may also check:How to resolve the algorithm Zumkeller numbers step by step in the 11l programming language
You may also check:How to resolve the algorithm Remove duplicate elements step by step in the Pop11 programming language
You may also check:How to resolve the algorithm Knuth shuffle step by step in the 11l programming language
You may also check:How to resolve the algorithm Sum of squares step by step in the Pascal programming language
You may also check:How to resolve the algorithm Arrays step by step in the Groovy programming language