#include <stdio.h>
int ft_str_is_numeric(char *str) {
while (*str) {
if (*str < '0' || *str > '9') {
return 0;
}
str++;
}
return 1;
}
int main() {
char str1[] = "123";
char str2[] = "12a";
printf("%d\n", ft_str_is_numeric(str1));
printf("%d\n", ft_str_is_numeric(str2));
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: