isalnum() in C++

isalnum(): This function is available in the file ctype.h. This function is used to check the character is alphanumeric or not. Check whether a character is either a decimal digit or letter.This function returns a value different from zero (i.e. true) if indeed c is either a digit or a letter. Zero (i.e. false) otherwise.

Parameters: One parameter is required for this function.

arg: The character to check for alphanumeric (alphabet+number).

Syntax:

isalnum(arg):

For Example:

1.isalnum('1') = > It return true.

2.isalnum('a') = > It returns true.

3.isalnum('-') = > It returns false.

Approach

C++

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

int main()
{
    char C = '1';
    cout << isalnum(C<< "\n";
    
    return 0;
}


No comments:

Post a Comment