-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putnbr.c
executable file
·32 lines (29 loc) · 1.08 KB
/
ft_putnbr.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
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rlechapt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/10 11:51:03 by rlechapt #+# #+# */
/* Updated: 2014/11/11 21:52:53 by rlechapt ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr(int n)
{
unsigned int nb;
nb = n;
if (n < 0)
{
ft_putchar('-');
nb = -n;
}
if (nb > 9)
{
ft_putnbr(nb / 10);
ft_putnbr(nb % 10);
}
else
ft_putchar(nb + '0');
}