CSharp examples for Language Basics:Operator
Using the modulus operators
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); } }