-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_putunsignednbr.c
More file actions
29 lines (26 loc) · 1.13 KB
/
ft_putunsignednbr.c
File metadata and controls
29 lines (26 loc) · 1.13 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
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putunsignednbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bschwitz <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/29 14:00:23 by bschwitz #+# #+# */
/* Updated: 2021/12/06 18:02:25 by bschwitz ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
#include <unistd.h>
int ft_putunsignednbr(unsigned int nb)
{
int total;
total = 0;
if (nb > 9)
{
total += ft_putunsignednbr(nb / 10);
total += ft_putunsignednbr(nb % 10);
}
else
total += ft_putchar(nb + '0');
return (total);
}