Diffrence between Write and WriteLine

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Shashangka-");
            Console.Write("Shekhar-");
            Console.Write("Mandal");
            //Output: Shashangka-Shekhar-Mandal

            Console.WriteLine();
            Console.WriteLine("ASp.Net");
            Console.WriteLine("MVC");
            //Output: ASp.Net
            //        MVC
            Console.ReadLine();
        }
    }
}

Explanation:

Console.Write("");

Stay on the same line.

Console.WriteLine();

Move to the next line.

Output:Untitled

 

Author:

Since March 2011, have 8+ years of professional experience on software development, currently working as Senior Software Engineer at s3 Innovate Pte Ltd.

Leave a Reply