how to round to nearest number in array csharp

Code Example - how to round to nearest number in array csharp

                
                        int[] array = {5,7,8,15,20};
int TargetNumber = 13;

var nearest = array.OrderBy(x => Math.Abs((long) x - targetNumber)).First();

//output = 15