Windows Phone Developers

Showing posts with label Mod Operator in CSharp. Show all posts
Showing posts with label Mod Operator in CSharp. Show all posts

Tuesday, May 10, 2011

Mod Functon in C# (Csharp)

Mod Operator in C#

Here is the code for Mod function in C#. Have given two ways. The first one is the C % operator

private void ModFunctionCsharpExample()
        {
            int iRemainder = 31 % 3;
            MessageBox.Show("Remainder is " + iRemainder.ToString());

            int iQuotient = Math.DivRem(31, 3, out iRemainder);
            MessageBox.Show("Remainder is " + iRemainder.ToString() + " and the Quotient is " + iQuotient);
        }

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon