Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save emrancu/21290b91421ef234e9a8ab1cbbf0a033 to your computer and use it in GitHub Desktop.
Save emrancu/21290b91421ef234e9a8ab1cbbf0a033 to your computer and use it in GitHub Desktop.
<?php
$caseNo = 0;
foreach (range(1, 9) as $numberOne) {
$makeNumberOne = ($numberOne * 100) + 62;
foreach (range(1, 9) as $numberTwo) {
$makeNumberTwo = ($numberTwo * 10) + 7;
$result = $makeNumberOne * $makeNumberTwo;
if (($result % 10 == 4) && ((int) ($result / 10000) == 5) && ((int) (($numberTwo * $makeNumberOne) / 1000) == 5)) {
echo '<h4>Case No: ' . ++$caseNo . "</h4>";
echo str_repeat('&nbsp;', 12);
echo $makeNumberOne;
echo '<br>x';
echo str_repeat('&nbsp;', 12);
echo $makeNumberTwo;
echo '<br>';
echo '-------------------';
echo '<br>';
echo str_repeat('&nbsp;', 10);
echo($makeNumberOne * 7);
echo '<br>';
echo str_repeat('&nbsp;', 8);
echo($numberTwo * $makeNumberOne);
echo '+<br>';
echo '-------------------';
echo '<br>';
echo str_repeat('&nbsp;', 8);
echo $result;
echo str_repeat('<br>', 2);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment