-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putunsigned.c
30 lines (27 loc) · 1.13 KB
/
ft_putunsigned.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_putunsigned.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: msabr <msabr@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/26 11:17:41 by msabr #+# #+# */
/* Updated: 2024/12/07 18:28:19 by msabr ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putunsigned(unsigned int nbr)
{
int compt;
char *base_int;
base_int = "0123456789";
if (nbr >= 10)
{
compt = ft_putnbr(nbr / 10);
return (compt + ft_putnbr(nbr % 10));
}
else
{
return (ft_putchar(base_int[nbr]));
}
}