Advertisement
ItsMeStevieG

Arithmetic Operators

Oct 15th, 2023
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2.  
  3. $a = 10;
  4. $b = 5;
  5.  
  6. // Addition
  7. $result = $a + $b // $result is 15
  8.  
  9. // Subtraction
  10. $result = $a -$b; // $result is 5
  11.  
  12. // Multiplication
  13. $result = $a * $b; // $result is 50
  14.  
  15. // Division
  16. $result = $a / $b; // $result is 2
  17.  
  18. // Modulus (remainder)
  19. $result = $a % $b; // $result is 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement