c# round to closest multiple

C#
int value = 30;
int factor = 16;
int nearestMultiple = 
        (int)Math.Round(
             (value / (double)factor),
             MidpointRounding.AwayFromZero
         ) * factor;
Source

Also in C#: