C isalpha()

The isalpha() function returns non-zero if ch is a letter of the alphabet; otherwise zero is returned. What constitutes a letter of the alphabet may vary from language to language. For English, these are the upper- and lower-case letters A through Z.

isalpha() Syntax

Following is the syntax of the isalpha() function :

int isalpha(int ch);

isalpha() Example

Following program checks each character read from stdin and reports all letters :

void main()
	char ch;
	for(; ;)
		ch = getchar();
		if(ch == '.')
			printf("%c is a letter\n", ch);

C Online Test

« Previous Chapter Next Function »