QP School

Full Version: Successor 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 successor of a number in Ruby you can do it as follows:


Quote:puts 1.succ


This will print 2 on the screen