Wednesday 16 April 2014

isalpha function in C

The function isalpha() returns non-zero if its argument is a letter of the alphabet. Otherwise it shall return 0 or False.
Header File - #include<ctype.h>, cctype(c++)
Syntex - isalpha(int ch)


 isalpha function Example1
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main ()
{
  char chr[]="abc123";
  int j=0;
  while (isalpha(chr[j]))
  {
         j++;
         printf ("The %d character are alphabet.\n",j);
  }
  getch();
}

                         Output                                    





Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments:

Post a Comment