Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 2nd, 2013  |  syntax: Ruby  |  size: 0.24 KB  |  views: 65  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. require 'mathn'
  2.  
  3. puts "random name"
  4. puts "random name"
  5. puts " "
  6.  
  7. puts "The program calculates the hypotenuse."
  8.  
  9. puts "Input a:"
  10. a = gets.to_i
  11.  
  12. puts "Input b:"
  13. b = gets.to_i
  14. c = Math.sqrt(a*a+b*b)
  15.  
  16. puts "hypotenuse c: " + c.to_s
  17.  
  18. gets
clone this paste RAW Paste Data