Skip to content
Justice Tech School

Value Types

int, double, bool, char, decimal and struct types hold their value directly. Use decimal for money.

Example
int i = 7;
long big = 10_000_000_000L;
decimal price = 19.99m;
float f = 1.5f;
byte b = 255;
Console.WriteLine($"{i} {big} {price} {f} {b}");

Exercise

Money type.

 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.