Advertisement
Guest User

calcfunc

a guest
Nov 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <?php
  2. is_numeric($first);
  3. is_numeric($second);
  4.  
  5. function getSum($first, $second)
  6. {
  7. $sum = $first+ $second;
  8. $result = $sum;
  9. return $sum;
  10. }
  11.  
  12. function getDif($first, $second)
  13. {
  14.  
  15. $dif = $first - $second;
  16. $result = $dif;
  17. return $dif;
  18. }
  19.  
  20. function getProd ($firsr, $second)
  21. {
  22.  
  23. $product = $first * $second;
  24. $result = $product;
  25. return $product;
  26. }
  27.  
  28. function getDiv ($first, $second)
  29. {
  30. $div = $first / $second;
  31. $result = $div;
  32. return $div;
  33. }
  34.  
  35. function getMax ($first, $second)
  36. {
  37. if($first< $second)
  38. {
  39. $max = $second;
  40. }
  41. else
  42. {
  43. $max = $first;
  44. }
  45. $result = $max;
  46. return $max;
  47. }
  48.  
  49. function getMin ($first, $second)
  50. {
  51.  
  52. if($first < $second)
  53. {
  54. $min = $first;
  55. }
  56. else
  57. {
  58. $min = $second;
  59. }
  60. $result = $min;
  61. return $min;
  62. }
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement