Day 16


 Hello

In continuation of yesterday's blog, I had informed you that today I will take the nest loop, which is a loop within a loop and is used to do several lloops instead of restarting the program. In yesterday's example, we were calculating the factorial for the number 5, and if we wanted to calculate the factorial for the number 6, we would have to restart the program from the beginning. However, instead of that, we can find the result of factorial 5 and factorial 6 and more without restarting the program through the nest loop.

Where we put a primary loop called the internal loop of the factorial and the second loop called the external loop of the factorial, and then when the user chooses to find the factorial for the number 5, it prints 120 and also prints "Enter another number to find the factorial" and it is possible to repeat the nest loop an infinite number of times. There is certainly an easier and faster way to do the same thing, but I do not know it yet. It will certainly be explained in the rest of the course.

تعليقات

المشاركات الشائعة