-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isdigit.c
34 lines (31 loc) · 1.12 KB
/
ft_isdigit.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
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isdigit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yeparra- <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/15 01:52:14 by yeparra- #+# #+# */
/* Updated: 2023/11/27 23:00:31 by yeparra- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isdigit(int digito)
{
if (digito >= 48 && digito <= 57)
return (1);
return (0);
}
int main()
{
int digit = '5';
if (ft_isdigit(digit))
{
printf("%c 1 \n", digit);
}
else
{
printf("%d 0 \n", digit);
}
return (0);
}