What is difference between console.writeline() and console.write() in c#

Posted by Jitendrasoft09 under C# on 6/26/2013 | Points: 10 | Views : 5117 | Status : [Member] [MVP] | Replies : 1
Hi All,
I want to understand What is difference between console.writeline() and console.write() in c#, let me know if anybody knows.

Jitendra Kumar
If my post helps you, plz mark as an answer.



Responses

Posted by: Satyapriyanayak on: 6/26/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
The Write () method outputs one or more values to the screen without a new line character.

The WriteLine() always appends a new line character to the end of the string. this means any subsequent output will start on a new line.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
class Program
{
static void Main()
{
Console.Write("Box");
Console.Write("Table");
Console.Write("chair");
Console.WriteLine();
Console.WriteLine("desk");
}
}



http://www.c-sharpcorner.com/Blogs/6518/

If this post helps you mark it as answer
Thanks

Jitendrasoft09, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response