-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isalnum.c
38 lines (35 loc) · 1.26 KB
/
ft_isalnum.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
35
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalnum.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yeparra- <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/15 10:17:48 by yeparra- #+# #+# */
/* Updated: 2023/11/27 23:01:03 by yeparra- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isalnum(int alpha_digit)
{
if (alpha_digit >= 48 && alpha_digit <= 57)
return (1);
if (alpha_digit >= 65 && alpha_digit <= 90)
return (1);
if (alpha_digit >= 97 && alpha_digit <= 122)
return (1);
return (0);
}
int main()
{
char digito = 'a';
if (ft_isalnum(digito))
{
printf("%c 1 \n", digito);
}
else
{
printf("%c 0 \n", digito);
}
return 0;
}