Blog

Diffrence between Write and WriteLine Methods in C#

Sep 05, 2011 Blogs | C# Programming
Here, In this blog we will see the difference between the Write and WriteLine methods in C#.
Introduction:

In this blog, we will see the difference between the Write and the WriteLine methods.

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"); 
    }
}


Output of the program:

write1.gif

Darwin Chaudhary

Darwin Chaudhary is working as a Software Tester.

  • 481rank
  • 82K readers
COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs