-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanynbr.c
48 lines (43 loc) · 1.21 KB
/
manynbr.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* manynbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atabiti <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/29 11:11:06 by atabiti #+# #+# */
/* Updated: 2021/12/08 08:37:57 by atabiti ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int manynbr(long holde)
{
int i;
i = 0;
if (holde <= 0)
{
holde = -holde;
i++;
}
while (holde > 0)
{
holde = holde / 10 ;
i++;
}
return (i);
}
int manyhex(unsigned long holde)
{
int i;
i = 0;
if (holde == 0)
{
return (1);
}
while (holde > 0)
{
holde = holde / 16;
i++;
}
return (i);
}