Take the greater of two nullable values
In one line using the null coalescing operator:
int? c = a > b ? a : b ?? a;
This works for any nullable:
Nullable.Compare(a, b) > 0 ? a : b;
In one line using the null coalescing operator:
int? c = a > b ? a : b ?? a;
This works for any nullable:
Nullable.Compare(a, b) > 0 ? a : b;