codescracker
c

C isblank()



« Previous Chapter Next Function »

isblank()

The isblank() function returns non-zero if ch is a character for which isspace() returns true and is used to separate words. Thus, for English, the blank characters are space and horizontal tab.

isblank() Syntax

Following is the syntax of the isblank() function :

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

isblank() Example

Following program checks each character read from stdin and reports the number of characters that separate words :

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

C Online Test


« Previous Chapter Next Function »



© Copyright 2021. All Rights Reserved.

CodesCracker