#include <unistd.h>

void    ft_putchar(char c)
{
        write(1, &c, 1); 
}

void    ft_putnbr(int nb)
{
        if (nb >= 0 && nb < 10)
        {
                ft_putchar(nb + '0');
        }
        else if (nb < 0)
        {       
                ft_putchar('-');
                nb = -nb;
                ft_putnbr(nb);
        }
        else if (nb >= 10)
        {       
                ft_putnbr(nb / 10);
                ft_putchar(nb % 10 + '0');
        }
        else
                return;
}

int     main(void)
{
        ft_putnbr(42);
        return (0);
}

~          

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: