How to print two variables on the same line (without jumping)? I've tried using print instead of puts but it did not work.
How to print two variables on the same line (without jumping)? I've tried using print instead of puts but it did not work.
Use the concatenation character +
print variavel1 + " " + variavel2
You can use this way to interpret variables within a string as well:
print "Primeira variavel: #{variavel1} Segunda variavel: #{variavel2}"
You can pass as 2 parameters
print variavel1,variavel2
I used a gets.chomp and it worked.