Skip to content
Justice Tech School

The Math Class

Math has Abs, Max, Min, Pow, Sqrt, Round, Floor, Ceiling and PI.

Example
Console.WriteLine(Math.Abs(-5));
Console.WriteLine(Math.Max(3, 9));
Console.WriteLine(Math.Pow(2, 10));
Console.WriteLine(Math.Sqrt(16));
Console.WriteLine(Math.Round(2.567, 1));
Console.WriteLine(Math.PI);

Exercise

Square root.

Math.(16)

Quiz Test

Which rounds to decimals?

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