-
-
Save emrancu/21290b91421ef234e9a8ab1cbbf0a033 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(' ', 12); | |
echo $makeNumberOne; | |
echo '<br>x'; | |
echo str_repeat(' ', 12); | |
echo $makeNumberTwo; | |
echo '<br>'; | |
echo '-------------------'; | |
echo '<br>'; | |
echo str_repeat(' ', 10); | |
echo($makeNumberOne * 7); | |
echo '<br>'; | |
echo str_repeat(' ', 8); | |
echo($numberTwo * $makeNumberOne); | |
echo '+<br>'; | |
echo '-------------------'; | |
echo '<br>'; | |
echo str_repeat(' ', 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