The main difference between the two is that Console.Write only prints the text or value that it has been given without the new line compared to Console.WriteLine() prints a new line after the text or value it was told to print.
For example the Console.Write() code printing the sentence “This is the first line” could look something like this:
Console.Write("this is");
Console.Write(" the first line");
or like this
Console.Write("this is the first line");
or like this
Console.Write("this is");
Console.Write(" the first");
Console.Write(" line");
This is because the console does not automatically print a new line after the text or value it was told to print.
If you were told to do the same thing with the Console.WriteLine() command it would look something like this:
Console.WriteLine("This is the first line");
Comment any questions below 🙂



Leave a comment