how to print to console in c# code example

Example 1: how to print in c#

Console.WriteLine("Hello World");

Example 2: c# print to console

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

Example 3: c# write to console

Console.Write("Hello");
Console.WriteLine("World");

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

Example 5: c# how to print

Console.WriteLine(/* your content here */);

Example 6: print to console c#

Console.WriteLine("Hello, world!"); // Prints: Hello, world!

Tags:

Java Example