Write a function that converts an uppercase letter to lowercase. Use the following function header:

char toLowerCase(char ch)
If the character is not an uppercase letter, the method simply returns the character itself. For example, toLowerCase('B') returns b and toLowerCase('5') returns 5. See Exercise 2.7 on how to convert an uppercase letter to lowercase. Write a test program that prompts the user to enter a character, invokes the function, and displays its return value.
```

Enter a char: A
a


Enter a char: 3
3

```

```
#include
using namespace std;

char upperCaseToLowerCase(char c)
{
if (c >= 'A' && c <= 'Z')
{
return (char)(c + ('a' - 'A'));
}

return c;
}

int main()
{
cout << "Enter a character: ";
char ch;
cin >> ch;
cout << upperCaseToLowerCase(ch) << endl;

return 0;
}
```

Computer Science & Information Technology

You might also like to view...

A ________ is a sequence of characters that is considered an object in JavaScript

Fill in the blank(s) with correct word

Computer Science & Information Technology

Simple Mail Transport Protocol (SMTP) server is used to send email for a client; the email is then routed to another SMTP server or other email server

Indicate whether the statement is true or false.

Computer Science & Information Technology