Differences between Console.Write and Console.WriteLine? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Differences between Console.Write and Console.WriteLine?

23rd Oct 2016, 10:36 AM
Simone Gramegna
Simone Gramegna - avatar
8 Answers
+ 10
As others have said, difference is WriteLine adds new line. so.. Console.Write("hi"); Console.Write("there"); will print: hithere but Console.WriteLine("hi"); Console.WriteLine("there"); will print: hi there
24th Oct 2016, 12:12 PM
Vanya
Vanya - avatar
+ 6
Console.Write print in line and Console.WriteLine print in next line.
23rd Oct 2016, 11:21 AM
Syed Taha Ahmed Zaidi
Syed Taha Ahmed Zaidi - avatar
+ 5
Console.WriteLine() works as a paragraph, adding a "\n" to the end of your string line.
24th Oct 2016, 10:18 AM
Hanike T.
Hanike T. - avatar
+ 2
"Console.Write"will leave the mouse cursor at same line.whereas "Console.WriteLine"will move the cursor to the next line after displaying output. eg. Console.Write ("hello"); hello | (mouse cursor (|) is here in same line). Console.WriteLine("hello"); hello | (mouse cursor (|) is in the line below the output.) supposing (|) is mouse cursor. Hope now it's clear for you guys.
8th Nov 2016, 1:48 AM
Budhathoki Bijaya
Budhathoki Bijaya - avatar
+ 1
As all have said as easier explain Console.Write prints on the same paragraph while Console.WriteLine prints on the next line of paragraph
8th Nov 2016, 3:26 PM
tosin fanegan
tosin fanegan - avatar
0
Console.Write prints on current line and stays there. Console.WriteLine prints on current line and ends the line.
23rd Oct 2016, 6:26 PM
Andreas BeEm Kvist
Andreas BeEm Kvist - avatar
0
single difference of next line..
24th Nov 2016, 6:06 PM
Karan Sachdeva
Karan Sachdeva - avatar
- 2
Console.write prints on the same line & Console.writeLine prints on the next line
25th Oct 2016, 6:12 AM
PATEL PRINCE SURESHKUMAR
PATEL PRINCE SURESHKUMAR - avatar