-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isdigit.c
32 lines (30 loc) · 1.15 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isdigit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gusgonza <gusgonza@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/13 18:28:39 by gusgonza #+# #+# */
/* Updated: 2024/02/16 20:15:53 by gusgonza ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isdigit(int c)
{
if (c >= 48 && c <= 57)
return (1);
return (0);
}
/* //For testing
#include <ctype.h>
#include <stdio.h>
int main(void)
{
int c = 0;
if(ft_isdigit(c))
printf("%d -> True\n", c);
else
printf("%d -> False\n", c);
return (0);
}*/