Chapter 2
Numbers

Now that you’ve gotten everything ready, it’s time to write your first program! Open your text editor, and type the following:

puts 1+2

Save your program (yep, that’s a complete program!) as calc.rb. Now run your program by typing ruby calc.rb into your command line. It should put a 3 on your screen. See, programming isn’t so hard, now is it?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.250.193