How to resolve the algorithm Loops/For with a specified step step by step in the Oberon-2 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Loops/For with a specified step step by step in the Oberon-2 programming language

Table of Contents

Problem Statement

Demonstrate a   for-loop   where the step-value is greater than one.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Loops/For with a specified step step by step in the Oberon-2 programming language

Source code in the oberon-2 programming language

MODULE LoopForStep;
IMPORT 
  Out;
VAR
  i: INTEGER;
 
BEGIN
  FOR i := 0 TO 10 BY 3 DO
    Out.LongInt(i,0);Out.Ln
  END;
  FOR i := 10 TO 0 BY -3 DO
    Out.LongInt(i,0);Out.Ln
  END
END LoopForStep.

  

You may also check:How to resolve the algorithm A+B step by step in the xEec programming language
You may also check:How to resolve the algorithm Zebra puzzle step by step in the Scala programming language
You may also check:How to resolve the algorithm Hofstadter Figure-Figure sequences step by step in the uBasic/4tH programming language
You may also check:How to resolve the algorithm Find common directory path step by step in the Run BASIC programming language
You may also check:How to resolve the algorithm Abbreviations, easy step by step in the VBA programming language