Write a PHP program to calculate the mod of two given integers without using any inbuilt modulus operator.
<?php function without_mod($m, $n) { $divides=(int)($m/$n); return $m-$n*$divides; } echo without_mod(13, 2)."\n"; echo without_mod(81, 3)."\n"; ?>
Sample Output:
1 0
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer