find the area of a parallelogram in ruby

To find the area of a parallelogram in Ruby, you can use the following formula:

main.rb
area = base * height
21 chars
2 lines

where base is the length of the parallelogram's base and height is the height of the parallelogram.

Here's an example code snippet that calculates the area of a parallelogram with given base and height:

main.rb
base = 6
height = 8
area = base * height

puts "The area of the parallelogram is #{area} units squared."
105 chars
6 lines

Output:

main.rb
The area of the parallelogram is 48 units squared.
51 chars
2 lines

gistlibby LogSnag