Skip to content
Justice Tech School

C# Data Types

C# has value types such as int, double, bool and char, and reference types such as string, arrays and classes. Sizes: int 32 bits, long 64 bits, float 32 bits, double 64 bits, decimal 128 bits for money.

Example
int i = 42;
long big = 9_000_000_000L;
float f = 1.5f;
double d = 2.75;
decimal money = 19.99m;
Console.WriteLine(i + " " + big + " " + f + " " + d + " " + money);

Exercise

Which type is best for money?

 price = 9.99m;

Quiz Test

Which type suits money?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.