-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putnbr.c
28 lines (25 loc) · 1.05 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: mgavillo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/09 14:49:51 by mgavillo #+# #+# */
/* Updated: 2018/11/25 20:10:05 by mgavillo ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr(int nb)
{
long n;
n = nb;
if (n < 0)
{
ft_putchar('-');
n = n * (-1);
}
if (n >= 10)
ft_putnbr(n / 10);
ft_putchar((n % 10) + '0');
}