-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_isalpha.c
More file actions
69 lines (61 loc) · 2.08 KB
/
ft_isalpha.c
File metadata and controls
69 lines (61 loc) · 2.08 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ygunay <ygunay@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/06 16:12:30 by ygunay #+# #+# */
/* Updated: 2022/07/14 07:51:33 by ygunay ### ########.fr */
/* */
/* ************************************************************************** */
/*
* LIBRARY
* #include <ctype.h>
* DESCRIPTION
* The isalpha() function tests for any character for which isupper(3) or
* islower(3) is true. The value of the argument must be representable as an
* unsigned char or the value of EOF.
* PARAMETERS
* #1. The character to test.
* RETURN VALUES
* The isalpha() function returns zero if the character tests false and
* returns non-zero if the character tests true.
*/
#include "libft.h"
int ft_isalpha(int c)
{
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
{
return (1);
}
return (0);
}
// int main(void)
// {
// int ret;
// ret = ft_isalpha('A');
// printf("return is %d\n", ret);
// ret = ft_isalpha('Z');
// printf("return is %d\n", ret);
// ret = ft_isalpha('a');
// printf("return is %d\n", ret);
// ret = ft_isalpha('z');
// printf("return is %d\n", ret);
// ret = ft_isalpha('1');
// printf("return is %d\n", ret);
// ret = ft_isalpha(' ');
// printf("return is %d\n", ret);
// return (0);
// }
// int main()
// {
// char c;
// printf("Enter a character: ");
// scanf("%c", &c);
// if (ft_isalpha(c) == 0)
// printf("%c is not an alphabet.", c);
// else
// printf("%c is an alphabet.", c);
// return 0;
// }