Mega Code Archive

 
Categories / Ruby / Statement
 

Do all the times tables from 1 to 12

1.upto(12) { |i| 1.upto(12) { |j| print i.to_s + " x " + j.to_s + " = ", j * i, "\n"} }