int value

In this chapter you will learn:

  1. int Max/Min value
  2. Assign value to int value

int Max/Min value

The data type defines the max and min values which it can hold.

using System;/* jav  a2 s  .c om*/

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(int.MaxValue);
        Console.WriteLine(int.MinValue);

    }
}

The output:

Assign value to int value

public class Main{
    static void Main( ) {
       int myInt = 7;
       System.Console.WriteLine("Initialized, myInt: {0}", myInt);
       myInt = 5;/*from   j  a v  a2 s  .com*/
       System.Console.WriteLine("After assignment, myInt: {0}",myInt);
    }
}

Next chapter...

What you will learn in the next chapter:

  1. Comparing integers using if statements, equality operators, and relational operators
Home » C# Tutorial » Byte, Integer, Long
Integer Family
Integer ranges
byte
Convert to byte
Parse string to byte
byte format
byte octal and hexadecimal
byte binary operation
byte overflow with unchecked
int
int value
Compare int value
int calculation
int value overflow
int binary operation
Parse string to int value
Format int value
int in binary, octal and hexadecimal
long
long value calculation
ulong