Factorial in ruby | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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
1 Resposta
0
Actually I want to understand Puts 1.upto(x).inject('*)
5th Mar 2022, 3:25 AM
SHIVAM ROHILLA