-
Notifications
You must be signed in to change notification settings - Fork 0
/
u.c
56 lines (49 loc) · 1.37 KB
/
u.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
50
51
52
53
54
55
56
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* u.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pboonpro <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/15 18:22:50 by pboonpro #+# #+# */
/* Updated: 2022/11/15 18:22:50 by pboonpro ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ulen(unsigned int num)
{
int i;
if (num == 0)
return (1);
i = 0;
while (num > 0)
{
i++;
num /= 10;
}
return (i);
}
int u(unsigned int num)
{
int len;
len = ulen(num);
if (num > 9)
{
u(num / 10);
num = num % 10;
}
if (num <= 9)
c(num + 48);
return (len);
}
/*int main()
{
int a;
int b = 425654;
int c;
a = u(b);
printf("\n%d\n", a);
c = printf("%i", b);
printf("\n%d\n", c);
return (0);
}*/