First Ruby Program

Problem solving with Ruby

The basic tools for understanding the flow and the results of simple programs are execution sheetsAn execution sheet is a manual way of observing and updating the values of the variables at each step of the execution of a program. and flowchartsA flowchart is a diagram that helps understand the sequence of instructions in a program having decision.. However, they become complicated when we have problems with a large number of decisions. Therefore we provide executable embedded code widgets to observe the program output by executing it.

Note: We can rerun a program as many times as we want, to try outputs for different inputs or values of variables.

In Ruby, we use gets for input (to read a value from the user).

Hello World

It’s time to write our first program in Ruby, which will simply display the message “Hello World!” on the screen.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy