Hi,

Here is my method to choose between all of types of repetition in a program.

Well, when I know the number of times for the repetition; I used the for loop.

When I don’t know but I know the condition to stop the repetition I used the while loop.

The recursive method is a little bit more tricky. I used it generally in the math exercise whose I know the formula. For example: fibonacci or the greatest common divisor. (We can check the codes on my others articles in this blog)

Have a good day !

CC BY 4.0 MASTERY 22 by aureliemartinette is licensed under a Creative Commons Attribution 4.0 International License.