-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putnbr_fd.c
38 lines (34 loc) · 1.17 KB
/
ft_putnbr_fd.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
30
31
32
33
34
35
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: azaghlou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/10 17:22:23 by azaghlou #+# #+# */
/* Updated: 2022/10/27 22:22:06 by azaghlou ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr_fd(int n, int fd)
{
long int s;
s = n;
if (s < 0)
{
s *= -1;
ft_putchar_fd('-', fd);
}
if (s >= 10)
{
ft_putnbr_fd(s / 10, fd);
ft_putnbr_fd(s % 10, fd);
}
else
ft_putchar_fd(s + 48, fd);
}
int main()
{
int a= 0000;
ft_putnbr_fd(a, 1);
}