-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putnbr.c
29 lines (26 loc) · 1.07 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hezzahir <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/08 20:31:18 by hezzahir #+# #+# */
/* Updated: 2018/11/08 21:42:59 by hezzahir ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr(int nb)
{
unsigned int nbr;
if (nb < 0)
{
ft_putchar('-');
nbr = nb * -1;
}
else
nbr = nb;
if (nbr >= 10)
ft_putnbr(nbr / 10);
ft_putchar(nbr % 10 + 48);
}