-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isalpha.c
33 lines (30 loc) · 1.38 KB
/
ft_isalpha.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edegraev <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/11 09:34:23 by edegraev #+# #+# */
/* Updated: 2023/11/16 09:16:31 by edegraev ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isalpha(int c)
{
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
return (1);
return (0);
}
// #include <stdio.h>
// int main(void)
// {
// printf("%d\n", ft_isalpha('a')); // 1
// printf("%d\n", ft_isalpha('A')); // 1
// printf("%d\n", ft_isalpha('z')); // 1
// printf("%d\n", ft_isalpha('Z')); // 1
// printf("%d\n", ft_isalpha('1')); // 0
// printf("%d\n", ft_isalpha(' ')); // 0
// printf("%d\n", ft_isalpha('\n')); // 0
// printf("%d\n", ft_isalpha('\0')); // 0
// }