isblank in c

What is isblank in c programming?

isblank in c checks whether the passed character is blank or not.

This function also considers tabspace.

This function is defined in ctype.h header file.

This function returns non-zero digit if passed character is blank otherwise zero.

Prototype

int isblank(int c);

Parameter

This function takes character as input parameter and converts it into ASCII value.

Return value

This function returns non-zero value if passed character is blank space otherwise zero.


Example program for isblank function in c

#include<stdio.h>
#include<ctype.h>
int main()
{
  char x=' ';
  if(isblank(x))
    printf("This is an blankspace \n");
  else
    printf("This is not an blankspace \n");
  return 0;
}
Example for isblank in c programming

Code explanation

isblank function is called to determine whether the passed character is blank or not. The result is printed onto the console.

isblank() Man page


Difference between isblank and isspace in c

isblank checks whether the passed character is blank or not. isspace function checks the input character is whitespace or not.

isblank function is used to identify blank spaces between words in a text of line. isspace simply returns character is space or not.

Prototypes are as follows

int isblank(int a);

int isspace(int a);
isblank function in cisspace function in c
Checks whether the passed character is blank or not.Checks the input character is whitespace or not.
int isblank(int a);int isspace(int a);

People also ask for

What is isblank in c?

isblank in c checks whether the passed character is blank or not. It is defined in ctype.h header file.

What is the difference between isblank and iscntrl in c?

iscntrl function terminates the process when it encounters a control character. isblank function is used to find blank space between the words in a line of text.