-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putnbr.c
28 lines (25 loc) · 1.04 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rnowell <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/09/24 15:16:20 by rnowell #+# #+# */
/* Updated: 2016/09/24 15:16:24 by rnowell ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr(int nb)
{
long n;
n = nb;
if (n < 0)
{
n = -n;
ft_putchar('-');
}
if (n > 9)
ft_putnbr(n / 10);
ft_putchar(n % 10 + '0');
}