divide the two numbers on your calculator, and multiply everything after the decimal by the divisor and that should give you the answer.
The Modulus Operator of C# is represented by the percent symbol (%). It has the same precedence as the multiplication and division operators (For example: 1 + 6 * 5 - 4 = 27 and not 31 as the multiplication, division and modulus operators have a higher level of precedence than the addition and substraction). it can be only used with integer numbers and returns the remainder of dividing the first (left) operand with the second (right) operand (for example: 20 % 7 = 6 how --> divide the two numbers and multiply everything after the decimal by the divisor and that should give you the answer. See the following code (from:"Sams Teach Yourself The C# Language in 21 days":


  1. class pie
  2. {
  3.    public static void Main()
  4.    {
  5.       int PiecesOfPie = 0;
  6.       int PiecesForMe = 0;
  7.  
  8.       int PiecesOfPie = 3 * 6;
  9.       PiecesForMe = 18 % 13;
  10.  
  11.       System.Console.WriteLine("Pieces Of Pie = {0}", PiecesOfPie);
  12.       System.Console.WriteLine("Pieces For Me = {0}", PiecesForMe);
  13.    }
  14. }

Another use of it is to check if the number is even or odd (from:"GeekPedia")


  1. int Num = 5;
  2. if (Num & 1)
  3. {
  4.    // It's odd
  5. }
  6. else
  7. {
  8.   // It's even
  9. }