integers and arithmetic operators : int Calculation « Data Type « C# / CSharp Tutorial






class MainClass
{

  public static void Main()
  {
    
    System.Console.WriteLine("10 / 3 = " + 10 / 3);
    System.Console.WriteLine("10 % 3 = " + 10 % 3);
    int intValue1 = 10;
    int intValue2 = 3;
    System.Console.WriteLine("intValue1 / intValue2 = " + intValue1 / intValue2);
    System.Console.WriteLine("intValue1 % intValue2 = " + intValue1 % intValue2);

  }
}
10 / 3 = 3
10 % 3 = 1
intValue1 / intValue2 = 3
intValue1 % intValue2 = 1








2.7.int Calculation
2.7.1.integers and arithmetic operators
2.7.2.int variable assignment
2.7.3.Overflowing an Integer Value
2.7.4.Bitwise AND of Integer
2.7.5.Comparing integers
2.7.6.Comparing the Prefix and Postfix Increment Operators
2.7.7.Using Binary Operators