-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_puthexa_up.c
32 lines (29 loc) · 1.13 KB
/
ft_puthexa_up.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_puthexa_up.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: azaher <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/31 16:50:27 by azaher #+# #+# */
/* Updated: 2022/10/31 16:51:22 by azaher ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_puthexa_up(unsigned int n)
{
int i;
char *lowbase;
i = 0;
lowbase = "0123456789ABCDEF";
if (n > 15)
{
i += ft_puthexa_up(n / 16);
i += ft_puthexa_up(n % 16);
}
else
{
i += ft_putchar(lowbase[n]);
}
return (i);
}