Absolute value of a number
In number line, the distance between number and origin is called absolute value of a number.
Absolute value of negative numbers
Absolute value of positive numbers
Since it is absolute value is a distance, it never be a negative value.
It is always positive.
Let’s take N,
If N is negative, return -N (minus of N)
Else, return N.
N = -2
- (-2) which is 2
N = 10