#include <unistd.h>

void	ft_putnbr(int nb)
{
	char	nbl;


	if (nb == -2147483648)
	{
		write(1, "-2147483648", 11);
	}
	else 
    {
        if (nb < 0)   
    	{
    		write(1, "-", 1);
            nb = nb * (-1);
    	}
    	if (nb > 9)
    	{
    		ft_putnbr(nb / 10);
    		ft_putnbr(nb % 10);
    	}
    	if (nb < 10)
    	{
    		nbl = nb + '0';
    		write(1, &nbl, 1);
    	}
    }
}
int	main(void)
{	
    ft_putnbr(45);
    write(1, "\n", 1);
    ft_putnbr(-45);
    write(1, "\n", 1);
    ft_putnbr(0);
    write(1, "\n", 1);
    ft_putnbr(-2147483648);
    return (0);
}

Embed on website

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