Created
July 24, 2016 08:05
-
-
Save AnkurVyas-BTC/df54acedf79ede45e7da2298fd9f83fe to your computer and use it in GitHub Desktop.
How to write simple case statement ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case | |
when input = '+' | |
puts 'The operation is addition' | |
when '-' | |
puts 'The operation is subtraction' | |
when '*' | |
puts 'The operation is multiplication' | |
else | |
puts 'The operation is division' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment