Advertisement
cbanowsky

STDOUT sum Ruby

Dec 2nd, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.32 KB | None | 0 0
  1. Instructions:
  2.  
  3. Given two integer numbers
  4. Your task is to
  5. write a function that prints their sum to the standard output (stdout)
  6. Note that your function will receive the following arguments:
  7. a
  8. which is the first integer number
  9. b
  10. which is the second integer number
  11.  
  12.  
  13.  
  14. def sum(a, b)
  15.   a + b
  16. end
  17. $stdout.puts sum(5, 6)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement