SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <unistd.h>
  3.  
  4. void    ft_putnbr(int nb);
  5.  
  6. void sum(int a, int b)
  7. {
  8.   ft_putnbr(a + b);
  9. }
  10.  
  11. void subtract(int a, int b)
  12. {
  13.   ft_putnbr(a - b);
  14. }
  15.  
  16. void mul(int a, int b)
  17. {
  18.   ft_putnbr(a * b);
  19. }
  20.  
  21. void div(int a, int b)
  22. {
  23.   if (b)
  24.     ft_putnbr(a / b);
  25.   else
  26.     write(1, "Stop : division by zero", 23);
  27. }
  28.  
  29. void mod(int a, int b)
  30. {
  31.   if (b)
  32.       ft_putnbr(a % b);
  33.   else
  34.       write(1, "Stop : modulo by zero", 21);
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top