We have taken the number as the following −
uint a = 9; uint b = 8;
Above, a is a divisor and b is dividend.
To compute modulus division.
Example
using System;
class Demo {
static uint display( uint a, uint b) {
return ( a & (b-1) );
}
static public void Main () {
uint a = 9;
uint b = 6;
Console.WriteLine( a + " modulus " + b + " = " + display(a, b));
}
}Output
9 modulus 6 = 1