Int32 Struct

Namespace: System
Represents a 32-bit signed integer. The Int32 value type represents whole numbers ranging from -2,147,483,648 through 2,147,483,647. The Int32 type is the most commonly used integral type.
Inheritance

Object Int32

Struct Members
Example
Basic Usage of Int32

using System;

public class Example
{
    public static void Main(string[] args)
    {
        int count = 100;
        long total = 1000000000L;

        Console.WriteLine($"The count is: {count}");
        Console.WriteLine($"The total is: {total}");

        // Perform arithmetic operations
        int sum = count + 50;
        Console.WriteLine($"Sum: {sum}");

        // Comparison
        if (count > 50)
        {
            Console.WriteLine("Count is greater than 50.");
        }

        // Parsing a string to int
        string numberString = "123";
        int parsedNumber = int.Parse(numberString);
        Console.WriteLine($"Parsed number: {parsedNumber}");

        // Using constants
        Console.WriteLine($"Maximum Int32 value: {int.MaxValue}");
        Console.WriteLine($"Minimum Int32 value: {int.MinValue}");
    }
}
        
See Also

Int64, Single, Double, Decimal