Guest User

Untitled

a guest
Feb 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. int my_put_nbr(int nb)
  2. {
  3. int result;
  4. int div;
  5.  
  6. div = 1;
  7. if (nb < 0)
  8. {
  9. my_putchar('-');
  10. nb = nb * -1;
  11. }
  12. while ((nb / div) >= 10)
  13. div = div * 10;
  14. while (div > 0)
  15. {
  16. result = (nb / div) % 10;
  17. my_putchar(result + 48);
  18. div = div / 10;
  19. }
  20. }
Add Comment
Please, Sign In to add comment