Guest User

Untitled

a guest
Jan 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2. function topla() {
  3. $toplam = 0;
  4. $argumanSayisi = func_num_args();
  5. for ($i = 0; $i < $argumanSayisi; $i ++) {
  6. $toplam += func_get_arg($i);
  7. }
  8. return $toplam;
  9. }
  10.  
  11. function carpma() {
  12. $carpim = 1;
  13. $argumanSayisi = func_num_args();
  14. for ($i = 0; $i < $argumanSayisi; $i ++) {
  15. if (func_get_arg($i) == 0)
  16. continue;
  17.  
  18. $carpim *= func_get_arg($i);
  19. }
  20. return $carpim;
  21. }
  22.  
  23. // Ornek Kullanim
  24. // echo carpma(2, 3, 4); // 24 dondurur
Add Comment
Please, Sign In to add comment