Module: Arithmetic expressions


Problem

3 /5


Built-in Functions

Theory Click to read/hide

Any programming language includes many built-in functions that can be used in arithmetic expressions.
To use additional functions, you often need to include additional libraries.

For example, the most commonly used standard mathematical functions and their notation in C#.

 Math.Abs(x) -  real module x;
 Math.Sqrt(x) -  square root of a real number x;
 Math.Pow(x,y) - < /code>calculates x to the power of y.

Remember that the function argument is always written in brackets.

Problem

Write a program that determines the distance between two points given coordinates x1  and x2 on the number line. The distance between two points is calculated using the formula |x2 − x1|.
The first input line contains a real number x1, the second line contains a real number x2. Output one real number – distance between two points.
Sample input and output data.
Input Output
1000
0
1000