+ 2

What's the difference between Console.Write and Console.WriteLine?

Console.Write vs Console.WriteLine

30th May 2017, 2:14 PM
Yehx H.
Yehx H. - avatar
3 Respuestas
+ 15
Console.WriteLine() goes to a new line after printing whereas Console.Write() doesn't. For example, Console.Write("Hello"); Console.Write("Hello"); -> HelloHello Console.WriteLine("Hello"); Console.WriteLine("Hello"); -> Hello Hello
30th May 2017, 2:24 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 1
Consol.WriteLine("Hello") change the line after print the given text but consol.Write("Hello") do not change line.
30th May 2017, 2:31 PM
Soussi Mohamed
Soussi Mohamed - avatar
+ 1
Console.WriteLine makes an automatic end of line, so any other output starts on a new line
31st May 2017, 2:30 AM
AmbaLander