-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isdigit.c
42 lines (36 loc) · 1.33 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
33
34
35
36
37
38
39
40
41
42
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isdigit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: evdos-sa <evdos-sa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/02 12:55:10 by evdos-sa #+# #+# */
/* Updated: 2022/11/18 20:22:06 by evdos-sa ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isdigit(int c)
{
if (c >= '0' && c <= '9')
return (1);
return (0);
}
/*
#include <stdio.h>
#include <ctype.h>
int main()
{
char c;
printf("Enter a character: ");
scanf("%c",&c);
if (ft_isdigit(c) == 0)
printf("%c is not a digit.",c);
else
printf("%c is a digit.",c);
if (isdigit(c) == 0)
printf("%c is not a digit.",c);
else
printf("%c is a digit.",c);
return 0;
}*/