isblank() in C/C++ Last Updated : 26 Apr, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Header File : ctype.h Declaration : int isblank(int ch) difference between isblank() and isspace() The isspace() simply return true if the character is a space. In other words blank character is a space character used to separate words within a line of text and isblank() is used to identify it. isblank() considers blank characters the tab character ('\t') and the space character (' '). isspace() considers space characters : (‘ ‘) – Space, (‘\t’) – Horizontal tab, (‘\n’) – Newline, (‘\v’) – Vertical tab, (‘\f’) – Feed, (‘\r’) – Carriage return Examples: Input: Geeks for Geeks Output: Geeks for Geeks Explanation: Since there are 2 spaces for Geeks for Geeks marked by an underscore( _ ) : Geeks_for_Geeks we replace the space with a newline character. isblank() C++ Program: This code prints out the string character by character, replacing any blank character by a newline. CPP // CPP program to demonstrate working // of isblank() #include <ctype.h> #include <iostream> using namespace std; int main() { string str = "Geeks for Geeks"; int i = 0; // to store count of blanks int count = 0; while (str[i]) { // to get ith character // from string char ch = str[i++]; // mark a new line when space // or horizontal tab is found if (isblank(ch)) { cout << endl; count++; } else cout << ch; } cout << "\nTotal blanks are : " << count << endl; return 0; } Output: Geeks for Geeks Total blanks are : 2 Comment More infoAdvertise with us Next Article isless() in C/C++ S shubham_rana_77 Follow Improve Article Tags : C++ C-String Practice Tags : CPP Similar Reads iswblank() function in C/C++ The iswblank() is a built-in function in C/C++ which checks if the given wide character is a blank character or not. It is defined within the cwctype header file of C++. Syntax: int iswblank(ch) Parameter: The function accepts a single mandatory parameter ch which specifies the wide character which 2 min read isless() in C/C++ In C++, isless() is a predefined function used for mathematical calculations. math.h is the header file required for various mathematical functions.isless() function used to check whether the 1st argument given to the function is less than the 2nd argument given to the function or not. Means if a is 2 min read islessequal() in C/C++ In C++, islessequal() is a predefined function in math.h. It is used to check whether the 1st floating point number is less than or equal to the 2nd floating point. The advantage it provides over simple comparison is, it does comparison without raising floating point exceptions. For example, if one 3 min read islessgreater() in C/C++ In C++, islessgreater() is a predefined function used for mathematical calculations. math.h is the header file required for various mathematical functions.islessgreater() function is used to check whether the 1st argument given to the function is less than or greater than the 2nd argument given to t 3 min read goto Statement in C++ The goto statement in C++ is a control flow statement that provides for an unconditional jump to the same function's predefined label statement. In simple terms, the goto is a jump statement transfers the control flow of a program to a labeled statement within the scope of the same function, breakin 5 min read strol() function in C++ The strtol() function in C++ interprets the contents of a string as an integral number of the specified base and return its value as a long int.This function also sets an end pointer that points to the first character after the last valid numeric character of the string, if there is no such characte 3 min read Like