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

Asked

Viewed 4,235 times

4

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

3 answers

15


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

  • @Matheusw honestly I consider the correct answer!

  • 4

    Ola Matheus, if you have any questions about programming logic and basic commands in c# I can send you the link to a pdf that helped me in early game college! :)

  • 1

    @Isabellaherman is in charge even if he has no doubts. I liked

  • 1

    @Matheusw please avoid being unpleasant in QA or you will end up banned.

  • 3

    Diego here’s the link, it’s really basic from comparisons with Portugol to Arrays theory, hopefully useful, hugs. https://drive.google.com/drive/folders/0ByvhxYLji0poZ1JMeWFtRzJMRlU?usp=sharing

  • 1

    @Isabellaherman thank you. I’m taking Unity course and am picking up any article that helps! Thank you. You know very much...!

Show 1 more comment

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
World

Console Method.Writeline
Console.Write method

7

Console.Write writes one or more values on output.

Console.WriteLine always adds a line break character after writing something on output. This causes anything that is written later to be in the line below.

  • your reply was good but I’m starting and do not understand so hard rsrs but thanks friend

  • 2

    @Matheusw I don’t understand. You need more details?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.