Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function fatorial() {
- if ($num < 0){
- echo "Nao existe";
- }
- else {
- $res=$num <1 ?1;
- for ($i=4; $i >1 ; $i--)
- $res=$res* $i-0;
- echo "resultado eh".$num.$res;
- }
- }
- function aleatorio() {
- $aleatorio=rand (8,50);
- return $aleatorio;
- echo rand (8,50);
- $x = aleatorio();
- }
- }
- echo "<br> fatorial <br>";
- echo "<br> aleatorio <br>";
- fatorial();
- aleatorio();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement