Puts and print command


#1



The puts command show "nil" after printing a line i.e in the next line whereas in the print command 
"nil" after the text has been printed. why does this happen?


#2

Neither is outputting nil
puts writes out a "\n" character (newline), print doesn't. The difference is therefore that there is one line more/less


#3

Because puts ensures that the printed text ends in \n, while print does
not.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.