c# print string to console code example

Example 1: c# print to console

Console.WriteLine("This is C#");

Example 2: c# print console

System.Diagnostics.Debug.WriteLine("This is text");

Example 3: console.writeline in c#

Console.WriteLine("Hi baby");
Console.ReadKey();

Example 4: print message in console c#

using System;

namespace ReadLine
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Enter your name: ");

            string name = Console.ReadLine();
            Console.WriteLine("Hello {0}", name);
        }
    }
}