print Statement : print « Development « Ruby






print Statement


# puts statement goes to the next line after printing the contents
# print statement the cursor is positioned on the same line


puts "Hello World"
puts "Good Morning"

# The output of this code is:

# Hello World
# Good Morning

# Now let's use the print statement and see what the output will be:

print "Hello World"
print "Good Morning"

 








Related examples in the same category

1.print vs puts
2.Prints nil: the variable exists but is not assigned