iswlower() function in C/C++

The iswlower() is a built-in function in C/C++ which checks if the given wide character is a lowercase character or not. It is defined within the cwctype header file of C++.

Syntax:

int iswlower(ch)

Parameters: The function accepts a single mandatory parameter ch which specifies the wide character which we have to check that if it is a lowercase character or not.



Return Value: The function returns two values as shown below.

  • If the parameter ch, is a lowercase character, then a non-zero value is returned.
  • If it is not a lowercase character then 0 is returned.

Below programs illustrates the above function.

Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

// C++ program to illustrate
// iswlower() function
#include <cwctype>
#include <iostream>
using namespace std;
  
int main()
{
  
    wchar_t ch1 = 'a';
    wchar_t ch2 = 'A';
  
    // Function to check if the character
    // is a lowercase character or not
    if (iswlower(ch1))
        wcout << ch1 << " is a lowercase character ";
    else
        wcout << ch1 << " is not a lowercase character ";
    wcout << endl;
  
    if (iswlower(ch2))
        wcout << ch2 << " is a lowercase character ";
    else
        wcout << ch2 << " is not a lowercase character ";
  
    return 0;
}

chevron_right


Output:

a is a lowercase character 
A is not a lowercase character

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

// C++ program to illustrate
// iswlower() function
#include <cwctype>
#include <iostream>
using namespace std;
  
int main()
{
  
    wchar_t ch1 = 'q';
    wchar_t ch2 = '?';
  
    // Function to check if the character
    // is a lowercase character or not
    if (iswlower(ch1))
        wcout << ch1 << " is a lowercase character ";
    else
        wcout << ch1 << " is not a lowercase character ";
    wcout << endl;
  
    if (iswlower(ch2))
        wcout << ch2 << " is a lowercase character ";
    else
        wcout << ch2 << " is not a lowercase character ";
  
    return 0;
}

chevron_right


Output:

q is a lowercase character 
? is not a lowercase character


My Personal Notes arrow_drop_up

Budding Web DeveloperKeen learnerAverage CoderDancer&Social Activist

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.