-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_unsigned.c
More file actions
25 lines (23 loc) · 1.11 KB
/
ft_unsigned.c
File metadata and controls
25 lines (23 loc) · 1.11 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_unsigned.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: eablak <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/21 11:01:03 by eablak #+# #+# */
/* Updated: 2022/10/21 11:22:02 by eablak ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_unsigned(unsigned int nbr, int *i)
{
if (nbr <= 9 && nbr >= 0)
*i += ft_putchr(nbr + '0');
if (nbr > 9)
{
ft_unsigned(nbr / 10, i);
ft_unsigned(nbr % 10, i);
}
return (*i);
}