Skip to content

Instantly share code, notes, and snippets.

@mikestratton
Created May 4, 2015 06:37
Show Gist options
  • Save mikestratton/b2e2d0a7c734dc6ad99f to your computer and use it in GitHub Desktop.
Save mikestratton/b2e2d0a7c734dc6ad99f to your computer and use it in GitHub Desktop.
Input 2 numbers from user, perform calculation and print results.
#!/usr/bin/ruby
# Request 2 numbers from user and perform calculation
print "Enter value of a: "
a = gets
print "Enter value of b: "
b = gets
print " a = " + a
print " b = " + b
print "b - a + 100 = " , (b.to_i - a.to_i + 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment