Advertisement
Gleidson_21

Operadores aritmeticos

Jun 22nd, 2021
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. <?php
  2. /*
  3. Operadores comuns
  4. echo 10+10;
  5. echo 10-10;
  6. echo 10*10;
  7. echo 10/10;
  8. */
  9.  
  10. echo "resto de divisão 10 % 3 = " . 10 % 3 . "<br>";
  11. echo "exponenciação 10 elevado a 2 = " . 10 ** 2 . "<br>";
  12.  
  13. $a = 10;
  14. $b = 20;
  15. $c = 30;
  16.  
  17. $adicao = $a + $b; //  e essa sintaxe serve para qualquer operação acima
  18. echo $adicao;
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement