Home »
C#.Net
Int32.MaxValue property with example in C#
C# Int32.MaxValue property: Here, we are going to learn about the MaxValue property of int (Int32) struct with its description, syntax, and example.
Submitted by IncludeHelp, on October 02, 2019
Int32.MaxValue Property
MaxValue property is GET property to get the maximum value of System.Int32.
Syntax:
int int.MaxValue;
Return value:
int – it returns the maximum value of System.Int32.
Int32.MaxValue Property Example in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int intMaxVal = 0;
intMaxVal = int.MaxValue;
Console.WriteLine("Return Type is : " + int.MaxValue.GetType());
Console.WriteLine("Max value of System.Int32 : " + intMaxVal);
}
}
}
Output
Return Type is : System.Int32
Max value of System.Int32 : 2147483647