125k views
0 votes
Assume that x is a char variable has been declared and already given a value. Write an expression whose value is true if and only if x is a upper-case letter.

User Eonil
by
5.6k points

1 Answer

3 votes

Answer:

bool b = isupper(x);

Explanation:

I have written the expression for a char variable x.The isupper(x) will return true if the character x is upper case and false if the character x is lower case.

I have stored the returned value to a bool variable b .So the value of variable b will be true only when the x is in uppercase and false when b is lower case.

User Fredblabla
by
5.4k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.