Write program to get the largest number in an array
Use each method on array
my_array = %w{10 56 92 3 49 588 18} highest_number = 0 # w ww. j a v a 2 s. c o m my_array.each do |number| number = number.to_i highest_number = number if number > highest_number end puts highest_number