feat: added ft_putnbr and ft-putunbr
This commit is contained in:
parent
9bf197acbd
commit
2a9b042122
2 changed files with 35 additions and 0 deletions
14
srcs/ft_putunbr.c
Normal file
14
srcs/ft_putunbr.c
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue