#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
bool isAlphabetic(const char *word) {
if (strlen(word) == 0) return 0;
while (*word) {
if (!isalpha(*word)) {
return false; // Non-alphabetic character found
}
word++;
}
return true; // All characters are alphabetic
}
int main() {
const char* word = ",c$programming.";
if (isAlphabetic(word)) {
printf("\"%s\" is alphabetic.\n", word);
} else {
printf("\"%s\" is not alphabetic.\n", word);
}
return 0;
}
/*
run:
",c$programming." is not alphabetic.
*/