-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_numlen.c
More file actions
29 lines (27 loc) · 1.01 KB
/
ft_numlen.c
File metadata and controls
29 lines (27 loc) · 1.01 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_numlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ppanchen <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/18 14:55:00 by ppanchen #+# #+# */
/* Updated: 2017/02/01 18:34:01 by ppanchen ### ########.fr */
/* */
/* ************************************************************************** */
int ft_numlen(int n)
{
int i;
i = 0;
if (n / 10 == 0)
return (1);
else
{
while (n > 0)
{
n = n / 10;
i++;
}
return (i);
}
}