public static void Main()
Console.WriteLine(ToNearestInteger(33.5));
Console.WriteLine(ToNearestInteger(34.5));
Console.WriteLine(ToNearestInteger(Convert.ToDouble(int.MaxValue) + 1.5));
public static int ToNearestInteger(double x)
var n = System.Math.Round(x);