C# Hello world code example

Example 1: c# hello world

using System; 
 
namespace HelloWorldApp { 

	class Program { 
		
		static void Main(string[] args) { 
			
			Console.WriteLine("Hello World!"); 
			Console.ReadKey(); 
		} 
	} 
}

Example 2: c# hello world

using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");

            // To prevents the screen from  
            // running and closing quickly 
            Console.ReadLine();
        }
    }
}

Example 3: c# hello world

Console.WriteLine("Hello World!");

Example 4: c# hello world

// Hello World! program
namespace HelloWorld
{
    class Hello {         
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}

Example 5: c# hello world

Console.WriteLine("Hello World!");

Example 6: c# hello world

// Hello World! program
namespace HelloWorld
{
    class Hello {         
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}

Example 7: C# hello world

// Hello World! program
namespace HelloWorld
{
    class Hello {         
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}

Example 8: C# Hello World

class Program
{
  static void Main(string[] args)
  {
    System.Console.WriteLine("Hello, World!");
  }
}

Example 9: c# hello world

using System;

class Hello
{
    static void Main()
    {
        Console.WriteLine("Hello, World");
    }
}

Example 10: C# hello world

Console.WriteLine("Hello World");