-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putun.c
30 lines (27 loc) · 1.07 KB
/
ft_putun.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putun.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yamzil <yamzil@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/10 20:52:52 by yamzil #+# #+# */
/* Updated: 2021/12/15 18:49:15 by yamzil ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putun(unsigned int nbr)
{
int i;
i = 0;
if (nbr < 10)
{
i += ft_putchar(nbr + 48);
}
else
{
i += ft_putun(nbr / 10);
i += ft_putun(nbr % 10);
}
return (i);
}