Mega Code Archive

 
Categories / C# Tutorial / Data Type
 

Overflowing an Integer Value

public class Program {   public static void Main()   {       // int.MaxValue equals 2147483647       int n = int.MaxValue;       n = n + 1 ;       System.Console.WriteLine(n);   } }