-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_countnbr.c
More file actions
28 lines (25 loc) · 1.02 KB
/
Copy pathft_countnbr.c
File metadata and controls
28 lines (25 loc) · 1.02 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_countnbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yel-mota <yel-mota@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/13 10:28:28 by yel-mota #+# #+# */
/* Updated: 2024/12/29 14:04:33 by yel-mota ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_countnbr(unsigned int n)
{
int i;
i = 0;
if (n == 0)
return (1);
while (n > 0)
{
n /= 10;
i++;
}
return (i);
}