def largest_in_array(arr)
    large = arr[0]
    arr.each do |right|
        large = right if right > large
    end
    puts large
end

largest_in_array([2, 42, 82, 122, 162, 202, 242, 282, 322, 362])

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: