iswupper() function in C/C++

The iswupper() is a built-in function in C/C++ which checks if the given wide character is a uppercase character or not. It is defined in CPP header file <cwctype.h> and This function is the wide-character equivalent of isupper ().

Syntax:

int iswupper(wint_t rs)

Parameters: The function accepts a single mandatory parameter rs which specifies the wide character which is to be checked.

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

  • non zero value – if rs has a uppercase character
  • zero – if rs has a no uppercase character

Below programs illustrate the above function.
Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

// C++ program to illustrate
// iswupper() function
#include <bits/stdc++.h>
using namespace std;
int main()
{
  
    wchar_t rs1 = 'S';
    wchar_t rs2 = 's';
  
    // Function to check if the character
    // is a uppercase character or not
    if (iswupper(rs1))
        wcout << rs1 << " is a uppercase character ";
    else
        wcout << rs1 << " is not a uppercase character ";
    wcout << endl;
  
    if (iswupper(rs2))
        wcout << rs2 << " is a uppercase character ";
    else
        wcout << rs2 << " is not a uppercase character ";
  
    return 0;
}

chevron_right


Output:

S is a uppercase character 
s is not a uppercase character

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

// C++ program to illustrate
// iswupper() function
#include <bits/stdc++.h>
using namespace std;
int main()
{
  
    wchar_t rs1 = 'R';
    wchar_t rs2 = '@';
  
    // Function to check if the character
    // is a uppercase character or not
    if (iswupper(rs1))
        wcout << rs1 << " is a uppercase character ";
    else
        wcout << rs1 << " is not a uppercase character ";
    wcout << endl;
  
    if (iswupper(rs2))
        wcout << rs2 << " is a uppercase character ";
    else
        wcout << rs2 << " is not a uppercase character ";
  
    return 0;
}

chevron_right


Output:

R is a uppercase character 
@ is not a uppercase character


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.