-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_nblen.c
21 lines (19 loc) · 1017 Bytes
/
ft_nblen.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_nblen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/04/15 14:20:41 by thifranc #+# #+# */
/* Updated: 2016/04/15 14:21:42 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_nblen(int nb)
{
if (0 <= nb && nb < 10)
return (1);
else
return (1 + ft_nblen(nb / 10));
}