Mega Code Archive

 
Categories / C# Tutorial / Data Type
 

Decimals and arithmetic operators

class MainClass {   public static void Main()   {          System.Console.WriteLine("10m / 3m = " + 10m / 3m);     decimal decimalValue1 = 10;     decimal decimalValue2 = 3;     System.Console.WriteLine("decimalValue1 / decimalValue2 = " + decimalValue1 / decimalValue2);   } } 10m / 3m = 3.3333333333333333333333333333 decimalValue1 / decimalValue2 = 3.3333333333333333333333333333