Mega Code Archive
Categories
/
Ruby
/
Range
With nested for loops, you can easily print out times tables from 1 to 12
for i in 1..12 for j in 1..12 print i.to_s + " x " + j.to_s + " = ", j * i, "\n" end end