LoginSignup
0
0

More than 3 years have passed since last update.

Ruby学習#18 If Statements(Con't)

Posted at

def max(num1, num2, num3)
if num1 >= num2 and num1 >= num3
return num1
elsif num2 >= num1 and num2 >= num3
return num2
else
return num3
end
end

puts max(1,2,3)

3

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0