Advertisement
Yanko-PT

Siham_ ALsadi's code modified

Apr 27th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.19 KB | None | 0 0
  1. <?php
  2. function expo($b,$e){
  3.     if($e == 0){
  4.         return 1;
  5.     }
  6.     $result = $b;
  7.     for($i=1;$i<$e;$i++){
  8.         $result *=$b;
  9.     }
  10.     return $result;
  11. }
  12. echo expo(2,3);
  13.  
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement