int isalpha(int ch) : isalpha « ctype.h « C / ANSI-C






int isalpha(int ch)



//Declaration:  int isalpha(int ch); 
//Return:       returns nonzero if ch is a letter or zero if not. 

  #include <ctype.h>
  #include <stdio.h>

  int main(void)
  {
    char ch;

    for(;;) {
       ch = getchar();
       if(ch == '.') {
          break;
       }
       if(isalpha(ch)) {
          printf("%c is a letter\n", ch);
       }
    }

    return 0;
  }

         
/*
a
a is a letter
a
a is a letter
d
d is a letter
.
*/
           
       








Related examples in the same category