SHARE
TWEET

Untitled

a guest Nov 2nd, 2013 67 Never
  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
RAW Paste Data
Top