Hi guys, trying to sort out this code, i have to get the program to check whether input is UPPER case or lower case. It then must tell the user that the letter they entered was in lower case or UPPER case.
So far i have:
#include <iostream>
using namespace std;
int main ()
{
char letter;
cout << "Please type a letter: ";
cin >> letter;
if ('z'>=letter<='a')
{
cout << "Letter entered was lowercase. " << endl;
}
else
}
cout << "Letter is not in lower case format " << endl;
{
system ("pause");
#include <iostream>
usingnamespace std;
int main ()
{
char letter;
cout << "Please type a letter: ";
cin >> letter;
if ('a'>=letter<='z')
{
cout << "Letter entered was lowercase. " << endl;
}
else
{
cout << "Letter is not in lower case format " << endl;
}
system ("pause");
return 0;
}
Still doesnt work. This is what im actually aiming to do with the program:
Write a c++ Program that accepts a character using the cin object and determine whether the character is a lowercase letter.
A lowercase letter is any character that is greater than or equal to a and less than or equal to z . If the entered character is a lower case letter, display the message The character just entered is a lowercase letter.
If the entered letter is not lowercase display The character just enetered is not a lowercase letter.