Thuta Learning
BasicProgrammingbeginner

Data Types

Relax. We'll talk through this in plain words — no textbook voice.

Knowing C#'s data types lets you store data correctly throughout your program. Right data type, right code; right code, fewer bugs. Think of it as deciding "what goes in the box" right from the start.

csharp
int quantity = 3;             // ကိန်းပြည့်
long population = 54000000L;   // ကြီးတဲ့ကိန်းပြည့်
double price = 19.99;          // ဒသမကိန်း
char grade = 'A';              // စာလုံးတစ်လုံး
bool isAvailable = true;       // true / false
string product = "Laptop";     // စာသား

Console.WriteLine($"{product} x {quantity}");
Console.WriteLine($"Price: {price}");
Console.WriteLine($"Available: {isAvailable}");

Key things to know

  • Value typesint, double, char, bool and similar types that store data directly.
  • Reference typesstring, arrays, classes, and the like. These hold a reference to where the object actually lives.
  • char uses single quotes 'A', while string uses double quotes "Hello".
You should see
Laptop x 3 Price: 19.99 Available: True
Data Types | Thuta Learning