Created
May 17, 2019 20:16
-
-
Save MaheKarim/21e52adfbca34cf594837b8190f22f76 to your computer and use it in GitHub Desktop.
Call to undefined function factorial()
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 | |
/** | |
* Created by PhpStorm. | |
* User: Mahe | |
* Date: 18-May-19 | |
* Time: 1:11 AM | |
*/ | |
include_once "functionsss.php"; | |
$x = 5; | |
echo "Factorial of {$x} is ".factorial($x); | |
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 | |
/** | |
* Created by PhpStorm. | |
* User: Mahe | |
* Date: 18-May-19 | |
* Time: 1:34 AM | |
*/ | |
function isEven ($myVar){ // Parameters | |
if ($myVar%2==0){ | |
return true; | |
} | |
return false; | |
} | |
function factorialCheck ($myVar){ | |
$result = 1; | |
for ($i= $myVar; $i>1; $i--){ | |
$result *= $i; | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment