QP School

Full Version: Predecessor in Ruby
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you want to get the predecessor of a number in Ruby you can do it as follows:


Quote:puts 1.pred


This will print 0 on the screen