C# Tutorial menu

C# Tutorial

C# (said "C sharp") is a modern programming language made by Microsoft. It runs on .NET, a free platform that works on Windows, macOS and Linux.

With C# you can build desktop software, websites and web APIs with ASP.NET, mobile apps with .NET MAUI, and games with the Unity engine.

Why Learn C#?

  • It is clean, modern and easy to read, even for beginners
  • It is used by many software houses in Pakistan and abroad for business software
  • Unity, one of the most popular game engines, uses C#
  • It manages memory for you, so you can focus on the logic

What You Will Learn

  • How to set up .NET and run your first program
  • Output, input, variables and data types
  • Operators, strings, if...else, switch and loops
  • Arrays and lists
  • Methods, classes and objects

A First Example

Example

csharp
Console.WriteLine("Hello from C#!");
Console.WriteLine($"2 + 3 = {2 + 3}");
Output
Hello from C#!
2 + 3 = 5

Modern C# lets a small program be just a few lines like this. You will learn what each part does in the first chapter.

Check Yourself

Exercise

Which platform do C# programs run on?

What to Learn After C#

C# is very close to Java, so learning one helps with the other. To understand what happens closer to the hardware, try C++ or C.

Want to learn programming with a teacher? The Workownix programming course starts with Python, and the same ideas (variables, loops, methods and classes) carry over directly to C#. Join online or at our institute in Orangi Town, Karachi.

Learn C# with a teacher

Join the Python Programming course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp