Junior — Middle
What are the main types of primitive data types you know?
sobes.tech AI
Answer from AI
The main primitive data types in C# include:
- int — integer (e.g., 32-bit)
- double — double-precision floating-point number
- float — single-precision floating-point number
- bool — boolean type (true or false)
- char — Unicode character
- string — sequence of characters (although technically a reference type, often used as a primitive)
- byte — unsigned integer from 0 to 255
- decimal — high-precision number, often used for financial calculations
Example usage:
int age = 30;
bool isActive = true;
char grade = 'A';
double price = 19.99;
string name = "Ivan";