Int32.MaxValue property with example in C#

Int32.MaxValue property with example in C#

C# Int32.MaxValue property: Here, we will find out about the MaxValue property of int (Int32) struct with its portrayal, syntax, and example.

Int32.MaxValue Property

MaxValue property is GET property to get the greatest value of System.Int32.

Syntax:

int int.MaxValue;

Return value:

int – it restores the greatest 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

Leave a Comment

error: Alert: Content is protected!!