codescracker


c

C isalpha()



« Previous Chapter Next Function »


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 :

#include<ctype.h>
int isalpha(int ch);

isalpha() Example

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

#include<ctype.h>
#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();
	char ch;
	for(; ;)
	{
		ch = getchar();
		if(ch == '.')
			break;
		if(isalpha(ch))
			printf("%c is a letter\n", ch);
	}
	getch();
}

« Previous Chapter Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test