Difference between Console.Write () and Console.WriteLine ()?

4

What is the difference between Console.Write() and Console.WriteLine() ?

    
asked by anonymous 20.07.2017 / 20:11

3 answers

14

Console.Write() writes continuously on the same line and Console.WriteLine() makes line breaks in code.

    
20.07.2017 / 20:11
8
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.WriteLine Method
Console.Write Method

    
20.07.2017 / 20:22
7

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.

    
20.07.2017 / 20:16