Thursday 5 January 2017

A library function, islower(),takes a single character (a letter) as an argument and returns a nonzero integer if the letter is lowercase, or zero if it is uppercase. This function requires the header file CTYPE.H. Write a program that allows the user to enter a letter, and then displays either zero or nonzero, depending on whether a lowercase or uppercase letter was entered. (See the SQRT program for clues.)

Leave a Comment


Question:

A library function, islower(),takes a single character (a letter) as an argument and returns a nonzero integer if the letter is lowercase, or zero if it is uppercase. This function requires the header file CTYPE.H. Write a program that allows the user to enter a letter, and then displays either zero or nonzero, depending on whether a lowercase or uppercase letter was entered. (See the SQRT program for clues.)

Explanation:
Below mention code is compiled in Visual Studio 2015 and Code Blocks 13.12,output snap is attached.. If any problem you feel and you want some explanation feel free to contact us.

Code:

/**************************************************|
/*************C++ Programs And Projects************|
***************************************************/
#include <iostream>
#include<ctype.h>
using namespace std;
int main()
{
       char letter;
       int result;
       cout << "Enter A letter ::";
       cin >> letter;
       result = islower(letter);
       cout << result<<endl;
       return 0;

}

Output:



Related Articles:

Object-Oriented Programming in C++ Fourth Edition By Robert Lafore Solution Manual

C++ Books Solution

If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: