84.9k views
5 votes
Assume that x is a char variable that 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 Cvibha
by
6.7k points

1 Answer

5 votes
#include <ctype.h>

int result;

result = ( toupper( x ) == x ) ? 1 : 0;
User Maheeka
by
6.4k points