0

Factorial in ruby

Def factorial(x) Puts 1.upto(x).inject('*') end factorial(5) Can anyone explain how this is executing ??

4th Mar 2022, 5:24 PM
SHIVAM ROHILLA
3 Answers
0
Actually I want to understand Puts 1.upto(x).inject('*)
5th Mar 2022, 3:25 AM
SHIVAM ROHILLA