Hello World in C#
Let's create your first application.
Create a Project
- Open Visual Studio.
- Click 'Create a new project'.
- Select Console App.
- Name it
HelloWorld.
The Code
csharp using System;
namespace HelloWorld { class Program { static void Main(string[] args) { Console.WriteLine("Hello, World!"); } } }
Breakdown
using System;: Allows us to use classes from the System namespace (likeConsole).static void Main: The entry point where the program starts.Console.WriteLine: Prints text to the screen.