04 How do I find the closest prime number?

The function “Nearest prime” searches for the prime number – either smaller or larger – with the smallest distance to the entered number.

Here, a number is simply entered and the output shows the closest prime number.