absolute value c# code example
Example 1: c# absolute value
int n = -5;
int abs_n = Math.Abs(n);
Example 2: c# convert to absolute value
Console.WriteLine($"{Math.Abs(value)}"); // -392 --> 392
int n = -5;
int abs_n = Math.Abs(n);
Console.WriteLine($"{Math.Abs(value)}"); // -392 --> 392