Use of recursion for repetitive algorithms

I saw this on: http://kenscourses.com/tc101winter2015/2015/use-of-recursion-for-repetitive-algorithms-6/

Basically, recursion in computer science is a method where the solution to a problem is based on solving smaller instances of the same problem.

Captura de pantalla 2016-11-07 a las 18.41.29.png

Recursion is multiplying n times n-1’s factorial f.e. if you choose 4 then the answer is 4×3! so its 4x3x2x1

When to use what type of repetition in a program

Depends on the program you are writing, the if loop does or stops the desired task until what you programmed tells the program to do so.

While loop does a task as long as something happens to do that task, after that it stops.

A for loop can be combined with while but for a desired value the program does something.