-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printdori.c
33 lines (31 loc) · 1.17 KB
/
ft_printdori.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printdori.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmita <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/25 11:42:37 by mmita #+# #+# */
/* Updated: 2023/01/28 19:09:47 by mmita ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void ft_printdori(int n, int *i)
{
if (n == -2147483648)
{
ft_printdori(n / 10, i);
ft_printchar('8', i);
}
else if (n < 0)
{
ft_printchar('-', i);
ft_printdori(-n, i);
}
else
{
if (n >= 10)
ft_printdori((n / 10), i);
ft_printchar(('0' + n % 10), i);
}
}