Learn Programming, Tech & Coding · Free Online Tools

IT Question Answer
Back to What Is
What is C# and Where is it Used?

What is C# and Where is it Used?

What Is2,106 viewsBy Admin
c-sharpwhereused

What is C#?

C# (pronounced "C-sharp") is a modern, object-oriented language by Microsoft that runs on the .NET platform. It powers Windows apps, web backends (ASP.NET), games (Unity), and cloud services on Azure.

Hello World

using System;
class Program {
    static void Main() {
        Console.WriteLine("Hello, C#!");
    }
}

Where C# Shines

  • Web — ASP.NET Core APIs and apps.
  • Games — Unity uses C# as its scripting language.
  • Desktop — WPF, WinForms, MAUI.
  • Cloud — first-class on Microsoft Azure.

Modern C# Features

var name = "Sara";                 // type inference
record User(string Name, int Age); // immutable records
string msg = name switch {         // switch expression
    "Sara" => "Hello Sara",
    _ => "Hello stranger"
};

FAQs

C# vs Java?

Very similar; C# has more modern syntax features. Choose based on platform/ecosystem. More in our C# guides.

Is C# only for Windows?

No — .NET Core/.NET 5+ run cross-platform on Linux and Mac.