Cast double value to int value - CSharp Language Basics

CSharp examples for Language Basics:Data Type Cast

Description

Cast double value to int value

Demo Code

using System;//from  w ww .  j a  v a2 s.c om
class ExplicitConversion {
   static void Main(string[] args) {
      double d = 1234.74;
      int i;
      // cast double to int.
      i = (int)d;
      Console.WriteLine(i);
      Console.ReadKey();
   }
}

Result


Related Tutorials