-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_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: igarbuz <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/08 11:18:57 by igarbuz #+# #+# */
/* Updated: 2018/11/08 11:45:58 by igarbuz ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr(int n)
{
long int l;
l = n;
if (l < 0)
{
ft_putchar('-');
l *= -1;
}
if (l / 10)
ft_putnbr(l / 10);
ft_putchar(l % 10 + '0');
}