This blog is under construction

Saturday, 17 March 2012

isblank()

Header file:
    ctype.h

Synopsis:
    int isblank (int input)

Description:
    Checks whether the given input is a black character(space or tab) or not

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


Sample Program:



  #include<stdio.h>
  #include<ctype.h>
  int main() {
        char c;
        printf("Enter your input:");
        /* give tab or space as input */
        c = getchar();

        if (isblank(c))
                printf("Given input is a space or a tab\n");
        else
                printf("neither tab nor space\n");


        printf("Return value of isblank: %d\n", isblank(c));
        return 0;
  }



  Output:
  Enter your input:   
  Given input is a space or a tab
  Return value of isblank: 1


No comments:

Post a Comment