Explanation:
The value of the variable c will be 0. The modulus (%) operator is used to find out the remainder after a division has been completed. This can be used with integers and floating point numbers.
The following example will demonstrate the use of the modulus operator:
- <?php
- $a=10;
- $b=4;
- $c= $a%$b;
- print($c);
- ?>
In the above program, the value of variable c will be 2.