The abs is an inbuilt method in Ruby returns the absolute value of a number.
Syntax: num.abs
Parameters: The function needs the number whose absolute value is to be returned.
Return Value: It returns the absolute value of a numbers.
Example 1:
Output:
19
Example 2:
Output:
100