+ 3
What's wrong with this code
4 Answers
+ 11
=begin
Ruby has no pre/post increment/decrement operator. For instance, number++ or number-- will fail to parse. Instead, Use number -= 1 or number = number - 1
=end
number = gets.to_i
sum = 1
print "The factorial of #{number} is "
while number > 0
sum *= number
number -= 1
end
puts sum
+ 13
@Esenyi : You're welcome :]
Regarding the best answer issue, this would help you out ...
https://www.sololearn.com/discuss/286211/?ref=app
https://www.sololearn.com/Discuss/286200/?ref=app
+ 3
Thanks a lot totally works, can't believe I thought so đđđđđđ
+ 3
One more thing how do I mark an answer as best