-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_int_len.c
26 lines (24 loc) · 1.02 KB
/
get_int_len.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_int_len.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mesafi <mesafi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/21 20:56:21 by mesafi #+# #+# */
/* Updated: 2020/01/21 20:56:26 by mesafi ### ########.fr */
/* */
/* ************************************************************************** */
int get_int_len(int nbr)
{
int count;
if (nbr == 0)
return (1);
count = 0;
while (nbr != 0)
{
nbr /= 10;
++count;
}
return (count);
}