Functional Programming, Csharp, Programming.
var result = Math.Divide(2, 0); if (result.HasValue) { // do something with a value ] else { // I am pretty much sure you will figure something out 😉 } In more complex scenarios you can consider a tuple: static class Math { public static (bool success, int result) Divide(int a, int b) { if (b == 0)