Absolute value
The absolute value of a real number is the distance of the number from zero on the number line. It is denoted by two vertical bars surrounding the number, like |x|. More formally, the absolute value of a real number x is defined as: |x| = x, if x is greater than or equal to…