What is the difference between Console.Write()
and Console.WriteLine()
?
What is the difference between Console.Write()
and Console.WriteLine()
?
Console.Write()
writes continuously on the same line and Console.WriteLine()
makes line breaks in code.
Console.Write() //Escreve o texto na mesma linha por exemplo:
Console.Write("Olá ");
Console.Write("Mundo");
Hello World
Console.WriteLine() //Escreve o texto e logo a seguir quebra para a linha seguinte por exemplo:
Console.WriteLine("Olá ");
Console.WriteLine("Mundo");
Hello there World
Console.Write
writes one or more values to output .
Console.WriteLine
always adds a line break character after typing something in output . This makes anything written later on the line below.