Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0027 Max value and Min value

The data type defines the max and min values which it can hold. using System; class Program { static void Main(string[] args) { Console.WriteLine(int.MaxValue); Console.WriteLine(int.MinValue); Console.WriteLine(byte.MaxValue); Console.WriteLine(byte.MinValue); } } The output: 2147483647 -2147483648 255 0