Can we use for loop for finding the factorial of n? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can we use for loop for finding the factorial of n?

please explain in detail

18th Oct 2017, 9:40 AM
Venkata Ratnam Dakoju
Venkata Ratnam Dakoju - avatar
1 Answer
+ 5
Yes, you can do it with simple for loop, foreach loop, while loop, do-while loop, recursion or even LINQ. Just head to Code Playground and there are plenty of examples! 😉
18th Oct 2017, 11:39 AM
Zephyr Koo
Zephyr Koo - avatar