Sabtu, 06 Juli 2013

How to check minimum or maximum value of integer data type

According to msdn ,  minimum and maximum value of Integer datatype are : -2,147,483,648 to 2,147,483,647.

Let's have an example :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace tutorial
{
   class Program
 {
   static void Main(string[] args)
 {
   int a = 0;
Console.WriteLine("minimum value of" + int.MinValue);
Console.WriteLine("maximum value of" + int.MaxValue);
Console.ReadKey();
 }
 }
}

Output
output
Here:
 MinValue field Represents the smallest possible value of System.Int32. This field is constant.
MaxValue field Represents the largest possible value of System.Int32. This field is constant

 

Tidak ada komentar:

Posting Komentar