using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
int a = 1;
int? b = a;
Console.WriteLine(b);
List<int> temp = new List<int>{1};
int? valueVariable = temp!=null && temp.Count>0 ? temp[0] : null ;
// Working Snippet with int? casting
//int? valueVariable = temp!=null && temp.Count > 0 ? (int?) temp[0] : null ;
Console.WriteLine(valueVariable);
}