Cast int to long implicit and cast in to short explicit : long cast « Data Type « C# / CSharp Tutorial






using System;

class MainClass
{
  static void Main(string[] args)
  {
    int MyInt = 12345;
    long MyLong = MyInt;  
    short MyShort = (short)MyInt;
  }
}








2.14.long cast
2.14.1.Cast int to long implicit and cast in to short explicit