#include <stdio.h>
#include <unistd.h>
void ft_putchar(char c) {
write(1, &c, 1);
}
void ft_putnbr(int nb) {
/* Special base case for negatives,
O/P a neg sign via ft_putchar();*/
if (nb < 0) {
ft_putchar('-');
nb = -nb;
}
/* More than a single digit, we use recursion here
to split off the MSD. */
if (nb >= 10) {
printf("\n MSD part past to recursion %d", nb/10);
printf("\n");
ft_putnbr(nb / 10);
nb = nb % 10;
printf("\n Stripper %d", nb%10);
}
/* General base case that we can use as output via the ft_putchar(). */
if (nb < 10) ft_putchar(nb + 48);
}
int main(void)
{
ft_putnbr(189);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: