How to resolve the algorithm Loops/Break step by step in the МК-61/52 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Loops/Break step by step in the МК-61/52 programming language

Table of Contents

Problem Statement

Show a loop which prints random numbers (each number newly generated each loop) from 0 to 19 (inclusive). If a number is 10, stop the loop after printing it, and do not generate any further numbers.
Otherwise, generate and print a second random number before restarting the loop.
If the number 10 is never generated as the first number in a loop, loop forever.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Loops/Break step by step in the МК-61/52 programming language

Source code in the мк-61/52 programming language

СЧ	2	0	*	П0
1	0	-	[x]	x#0	18
СЧ	2	0	*	П1
БП	00	ИП0	С/П


  

You may also check:How to resolve the algorithm Arithmetic evaluation step by step in the Julia programming language
You may also check:How to resolve the algorithm Sort using a custom comparator step by step in the Fantom programming language
You may also check:How to resolve the algorithm Play recorded sounds step by step in the Liberty BASIC programming language
You may also check:How to resolve the algorithm Abstract type step by step in the PicoLisp programming language
You may also check:How to resolve the algorithm Sierpinski pentagon step by step in the Action! programming language