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