Skip to content

Instantly share code, notes, and snippets.

@ryanckulp
Created January 1, 2018 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanckulp/5476f79b1b015c3e539d8306343c716f to your computer and use it in GitHub Desktop.
Save ryanckulp/5476f79b1b015c3e539d8306343c716f to your computer and use it in GitHub Desktop.
multiple if examples in Ruby
# question 1, answer: 4
if 2 + 2 == x
alert "Correct!"
else
alert "Incorrect!"
end
# question 2, answer: 11
if 4 + 7 == x
alert "Correct!"
else
alert "Incorrect!"
end
# question 3, answer: 10
if 7 + 3 == x
alert "Correct!"
else
alert "Incorrect!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment