Welcome to the C# Basics section! This guide will help you understand the fundamental concepts of C# programming. 🚀

🧠 Core Concepts

  • Variables 📦
    Use var or explicit types to declare variables. Example:

    var name = "Alice"; // Inferred type
    string message = "Hello, World!"; // Explicit type
    
    CSharp_Variables
  • Data Types 📊
    C# supports:

    • Primitive types: int, float, bool, char
    • Reference types: string, object, class
    • Composite types: array, struct
    • User-defined types: enum, interface
    CSharp_Data_Types
  • Control Flow ⚙️
    Master if, switch, for, while, and do-while statements.
    Example:

    if (x > 0) { Console.WriteLine("Positive"); }
    for (int i = 0; i < 5; i++) { /* Loop body */ }
    
  • Functions 🧩
    Define reusable blocks with:

    public int Add(int a, int b) {
        return a + b;
    }
    
    CSharp_Functions
  • Classes & Objects 🏗️
    Create classes to define objects:

    public class Person {
        public string Name { get; set; }
        public void SayHello() { Console.WriteLine("Hello!"); }
    }
    

📚 Expand Your Knowledge

For deeper insights into C# programming, check out our C# Advanced Topics guide.

Let us know if you need further assistance! 😊