--Originally published at Just A Turtle Coding.
A quick tutorial on how to make the factorial function using a while loop.
First you have to state a counting variable for it to go through the while loop, you also have to declare a variable where the total will be stored.
Then it’s just a piece of cake, you have to multiply the variable where the total is being stored. Important note, the variable with the total can’t be 0, it has to start at 1 for it to be multipliable.