feat: added ft_putnbr and ft-putunbr

This commit is contained in:
Zoëy Noort 2025-05-11 19:23:16 +02:00
parent 9bf197acbd
commit 2a9b042122
2 changed files with 35 additions and 0 deletions

14
srcs/ft_putunbr.c Normal file
View file

@ -0,0 +1,14 @@
#include "libft.h"
#include <unistd.h>
int ft_putunbr(unsigned int n)
{
int count = 0;
char c;
if (n >= 10)
count += ft_putunbr(n / 10);
c = '0' + (n % 10);
count += ft_putchar(c);
return count;
}