Check Data-type Max and Min values

Rajesh_Kumar
Posted by Rajesh_Kumar under C# category on | Points: 40 | Views : 1159
byte a1 = byte.MaxValue;
short b1 = short.MaxValue;
int c1 = int.MaxValue;
long d1 = long.MaxValue;

byte a2 = byte.MinValue;
short b2 = short.MinValue;
int c2 = int.MinValue;
long d2 = long.MinValue;

Console.WriteLine(a1);
Console.WriteLine(b1);
Console.WriteLine(c1);
Console.WriteLine(d1);

Console.WriteLine(a2);
Console.WriteLine(b2);
Console.WriteLine(c2);
Console.WriteLine(d2);


Output would be:
255
32767
2147483647
9223372036854775807

0
-32768
-2147483648
-9223372036854775808

Comments or Responses

Login to post response