-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printdecimal.c
More file actions
31 lines (28 loc) · 1.11 KB
/
ft_printdecimal.c
File metadata and controls
31 lines (28 loc) · 1.11 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
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printdecimal.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: havyilma <havyilma@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/24 20:25:10 by havyilma #+# #+# */
/* Updated: 2022/10/31 16:50:18 by havyilma ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printdecimal(unsigned int i)
{
int a;
a = 0;
if (i > 10)
{
a += ft_printdecimal (i / 10);
a += ft_printdecimal (i % 10);
}
if (i >= 0 && i <= 9)
{
i += 48;
a += ft_putchar(i);
}
return (a);
}