← C# Programming learning path
C# Programming · Module 2 of 10

Variables, types and operators

Store data with value and reference types.

📖 Key ideas

  1. Types: int, double, decimal, bool, char, string.
  2. var infers the type: var count = 5;
  3. decimal suits money calculations.
  4. const for compile-time constants; readonly for runtime-set fields.
  5. String interpolation: $"Hello {name}".
💡 Real-life example: Types are labelled jars: rice in the rice jar, sugar in the sugar jar, no mixing.
intWhole number type
decimalHigh-precision number for money
varImplicitly typed local
$"..."Interpolated string