using System;
public class Program
{
public static void Main()
TestClass tc = null;
//TestClass tc = new TestClass() { A = 5 };
if (tc?.A == null) {
Console.WriteLine("value is null");
}
if (null != 0)
Console.WriteLine("zero doesn't equal null");
if (tc?.A != 0)
Console.WriteLine("value is null and doesn't equal zero");
if ((tc?.A ?? 0) != 0)
Console.WriteLine("not zero or null");
public class TestClass
public int A {get;set;}