isprint() in C++

isprint(): This function is available in the file ctype.h. This function checks whether a given character is printable or not. printable character is a character that occupies a printing position on a display. This function returns a value different from zero (i.e. true) if indeed c is a printable character. Zero (i.e. false) otherwise.

Parameters: One parameter is required for this function.

arg: The character to be checked, cast to an int.

Syntax:

isprint(arg)

For Example:

isprint('a') = > It returns true (any non-zero value).

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    char Ch = 'a';
    cout << isprint(Ch<< "\n";

    return 0;
}


No comments:

Post a Comment