First C# program
Introduction
In this lesson, you will learn how to write your first C# program (Hello World) using Visual Studio. This is the first step in learning .NET programming.
What is a C# Program?
A C# program is a set of instructions written using the C# language that tells the computer what to do.
Write Your First Program
Follow these steps:
- Open Visual Studio
- Click Create a new project
- Select Console App (.NET)
- Click Create
Hello World Code
using System;
class Program
{
static void Main()
{
Console.WriteLine(“Hello World”);
}
}
Run the Program
- Click Run ▶️
- Output will display:
Hello World
Code Explanation
using System;→ Uses system libraryMain()→ Starting point of programConsole.WriteLine()→ Prints output
Real-World Use
Every application starts with basic logic like this before building complex systems.
Key Points
- C# is the main language in .NET
- Every program starts from
Main() - Output is shown using
Console.WriteLine()
Internal Link
- Course Page: .NET Course for Beginners



