Using Binary Operators : int Calculation « Data Type « C# / CSharp Tutorial






class Division
{
  static void Main()
  {
      int numerator;
      int denominator;
      int quotient;
      int remainder;

      System.Console.Write("Enter the numerator: ");
      numerator = int.Parse(System.Console.ReadLine());

      System.Console.Write("Enter the denominator: ");
      denominator = int.Parse(System.Console.ReadLine());

      quotient = numerator / denominator;
      remainder = numerator % denominator;

      System.Console.WriteLine("{0} / {1} = {2} with remainder {3}",numerator, denominator, quotient, remainder);
  }
}








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