Home » C++ programs

iswlower() function in C++

C++ iswlower() function with Example: Here, we are going to learn about the iswlower() function of cwtype.h header file with example.
Submitted by Raja Sethupathi V, on January 30, 2019

The iswlower() function is defined in the header file <cwctype.h>.

Prototype:

    int iswlower(wchar_t rs);

Parameter:

wchar_t rs – Checks the given character is in lower case or not.

Return type:

The function returns two values:

  1. Zero: if rs is non - lowercase character.
  2. Non Zero: if rs is lowercase character.

Use of function

The iswlower() is built- in function in C++, which is used to check the given character, rs is in lower case or not .

Program 1:

#include <cwctype> 
#include <iostream> 
using namespace std; 

int main() {   
	wchar_t rs1 = 'H'; 
	wchar_t rs2 = 'e'; 
	wchar_t rs3 = 'l';
	wchar_t rs4 = 'P';

	// Function to check if the character 
	// is a lowercase character or not 
	if (iswlower(rs1)) 
		wcout << rs1 << " is a lowercase "; 
	else
		wcout << rs1 << " is not a lowercase "; 
	wcout << endl; 

	if (iswlower(rs2)) 
		wcout << rs2 << " is a lowercase "; 
	else
		wcout << rs2 << " is not a lowercase "; 
	wcout << endl; 
	
	if (iswlower(rs3)) 
		wcout << rs3 << " is a lowercase "; 
	else
		wcout << rs3 << " is not a lowercase  "; 
	wcout << endl; 
	
	if (iswlower(rs4)) 
		wcout << rs4 << " is a lowercase  "; 
	else
		wcout << rs4 << " is not a lowercase  "; 
	wcout << endl; 

	return 0; 
}

Output

H is not a lowercase 
e is a lowercase 
l is a lowercase 
P is not a lowercase  

Program 2:

#include <cwctype> 
#include <iostream> 
using namespace std; 

int main() {   
	wchar_t rs1 = '.'; 
	wchar_t rs2 = 'c'; 
	wchar_t rs3 = '?';
	wchar_t rs4 = 'm';

	// Function to check if the character 
	// is a lowercase character or not 
	if (iswlower(rs1)) 
		wcout << rs1 << " is a lowercase "; 
	else
		wcout << rs1 << " is not a lowercase "; 
	wcout << endl; 

	if (iswlower(rs2)) 
		wcout << rs2 << " is a lowercase "; 
	else
		wcout << rs2 << " is not a lowercase "; 
	wcout << endl; 
	
	if (iswlower(rs3)) 
		wcout << rs3 << " is a lowercase "; 
	else
		wcout << rs3 << " is not a lowercase  "; 
	wcout << endl; 
	
	if (iswlower(rs4)) 
		wcout << rs4 << " is a lowercase  "; 
	else
		wcout << rs4 << " is not a lowercase  "; 
	wcout << endl; 

	return 0; 
}

Output

. is not a lowercase 
c is a lowercase 
? is not a lowercase  
m is a lowercase  





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.