print to console in c# code example
Example 1: c# print to console
Console.WriteLine("This is C#");
Example 2: c# write to console
Console.Write("Hello");
Console.WriteLine("World");
Example 3: 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 4: c# printing to console
Console.WriteLine("Hello World");