title: Cannot implicitly convert type 'long' to "int?"?
body: <p>It a very simple question - convert a type long variable to a Nullable int type (int?). (see example below- not the actual code)</p>
  
  <pre><code>int? y = 100;
  
  long x = long.MaxValue;
  
  y = x;
  </code></pre>
  
  <p>I am getting compile time error.</p>
  
  <p>"Cannot implicitly convert type 'long' to 'int?'. An explicit conversion exists (are you missing a cast?).</p>
  
  <p>I do have the fix ( see below the solution section), My curiosity in posting the question is of the 3 solutions which one is recommended?</p>
  
  <p>Solution</p>
  
  <pre><code>  y = Convert.ToInt32(x);
    y = (int)x;
    y = unchecked((int) x);  
  </code></pre>
  
  <p>Thanks in advance for your suggestions</p>