-
Notifications
You must be signed in to change notification settings - Fork 0
/
printtoolss.c
49 lines (44 loc) · 1.38 KB
/
printtoolss.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
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* printtoolss.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kael-ala <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/10 19:25:25 by kael-ala #+# #+# */
/* Updated: 2023/12/11 10:51:43 by kael-ala ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putexa_upper(unsigned long long n)
{
int count;
char *buff;
count = 0;
buff = "0123456789ABCDEF";
if (n > 15)
{
count += ft_putexa_upper(n / 16);
count += ft_putexa_upper(n % 16);
}
else
count += ft_putchar(buff[n]);
return (count);
}
int ft_putunbr(unsigned int n)
{
unsigned long nbr;
int count;
nbr = n;
count = 0;
if (nbr < 10)
{
count += ft_putchar(nbr + 48);
}
else
{
count += ft_putunbr(nbr / 10);
count += ft_putunbr(nbr % 10);
}
return (count);
}