////////////////////////////////////////////////////////////////// // File: NumericType.cs // Class: NumericType // This program tests C# numerical types. // -Kyoung Shin Park (2009 Fall) ////////////////////////////////////////////////////////////////// using System; class NumericType { static void Main( string[] args ) { int intVal = 10; Console.WriteLine("intVal = {0}", intVal); //intVal = 10 intVal = 10 + 15; Console.WriteLine("intVal = {0}", intVal); // intVal = 25 long longVal = 1234567890123456789; Console.WriteLine("longVal = {0}", longVal); // longVal = 1234567890123456789 float floatVal = 1.234f; Console.Write("floatVal = "); Console.WriteLine(floatVal); // floatVal = 1.234 double doubleVal = 3.14; Console.Write("doubleVal = "); Console.WriteLine(doubleVal); // doubleVal = 3.14 decimal decimalVal = 16.24m; Console.WriteLine("decimal = " + decimalVal); // decimalVal = 16.24 // Keep the console window open in debug mode. Console.WriteLine("Press any key to exit."); Console.ReadKey(); } }