Q:

iswlower() function in C++

belongs to collection: C++ programs on various topics

0

iswlower() function in C++

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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  

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ programs on various topics

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
iswupper() function in C++... >>
<< Representing System of Linear Equations using Matr...