-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putnbr.c
28 lines (25 loc) · 1.06 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: moboulan <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/26 18:15:15 by moboulan #+# #+# */
/* Updated: 2025/01/28 23:15:42 by moboulan ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr(int n)
{
long nbr;
nbr = (long)n;
if (nbr < 0)
{
ft_putchar('-');
nbr = -nbr;
}
if (nbr >= 10)
ft_putnbr(nbr / 10);
ft_putchar((nbr % 10) + '0');
}