Using the modulus operators - CSharp Language Basics

CSharp examples for Language Basics:Operator

Description

Using the modulus operators

Demo Code

class pie//from  w  w  w . j  a  va  2 s.co m
{
   static void Main()
   {
      int PiecesForMe = 0;
      int PiecesOfPie = 0;

      PiecesOfPie = 3 * 6;

      PiecesForMe =  PiecesOfPie % 13;

      System.Console.WriteLine("Pieces Of Pie = {0}", PiecesOfPie);
      System.Console.WriteLine("Pieces For Me = {0}", PiecesForMe);
   }
}

Result


Related Tutorials