Factorial in ruby | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponse
0
Actually I want to understand Puts 1.upto(x).inject('*)
5th Mar 2022, 3:25 AM
SHIVAM ROHILLA