Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. function divisao(dividendo, divisor){
  2. var quociente = 0;
  3. var resto = 0;
  4. while(dividendo > 0 && dividendo >= divisor){
  5. quociente = soma(quociente, 1);
  6. dividendo = subtrair(dividendo, divisor);
  7. }
  8.  
  9. resto = dividendo;
  10.  
  11. return {quociente, resto}
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement