int if null put zero c# code example Example: int if null put zero c# var number = null; int result = number.GetValueOrDefault();