I am doing exercises on algorithms I and I have a question about the statement that asks to do 1-n cycles.
The statement is: Rewrite the algorithms MI-16 to MI-18, using 1-n cycles
And MI-16 to MI-18 are as follows:
MI-16: Enter and report values, as long as the entered value is not negative. Inform the number of values entered.
MI-18: Given a value M, determine and issue a list with the first M multiples of 3 that are not multiples of 5, within the set of natural numbers
What would a 1-n loop be?
It is simply a loop that runs the first time and depending on what happens inside it, it can run n number of times until something happens to terminate it.
EXAMPLE
A window will be displayed once and if they enter a letter it will print it on the screen, then it will show the window again and if they enter another letter it will print it too, then the window will come out again and if they enter a number it will fail and exit the cycle, if ever enter a number will be executed n number of times that the data is entered correctly. but it was complied with that it was executed the first time.