This blog is under construction

Saturday, 17 March 2012

islower example in C

Header file:
    ctype.h

Synopsis:
    int islower (int input)

Description:
    checks whether the given input is a lower case character or not.

Return Value:
    TRUE(a non-zero value) on success
    0 on failure


islower function C example


  #include<stdio.h>
  #include<ctype.h>
  int main() {
       char a;
       printf("Enter a character:");
       a = getchar();

       if (islower(a))
         printf("The given character is in lower case\n");
      else
         printf("The given character is not in lower case\n");

       printf("Return value from islower:%d\n", islower(a));
       return 0;
  }



  Output:
  jp@jp-VirtualBox:~/$ ./a.out
  Enter a character:a
  The given character is in lower case
  Return value from islower: 512


No comments:

Post a Comment