Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ft_putnbr(int nb)
- {
- int x[2];
- if (nb < 0)
- {
- nb = nb * (-1);
- ft_putchar('-');
- }
- if (nb == 0)
- {
- ft_putchar('0');
- }
- while (nb > 0)
- {
- x[0] = nb;
- x[1] = 1;
- while (x[0] >= 10)
- {
- x[0] = x[0] / 10;
- x[1] = x[1] * 10;
- }
- ft_putchar('0' + x[0]);
- nb = nb - (x[0] * x[1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement