C programming ctype.h function - int isupper(int c)

https://w‮itfigi.ww‬dea.com

The int isupper(int c) function in the ctype.h library of C programming is used to determine whether a given character is an uppercase letter.

The isupper() function takes a single integer argument c, which is the character to be checked. The function returns an integer value, which is nonzero if the character is an uppercase letter, and zero otherwise.

Here's an example of how to use the isupper() function in C:

#include <stdio.h>
#include <ctype.h>

int main() {
    char c = 'A';
    if (isupper(c)) {
        printf("%c is an uppercase letter\n", c);
    } else {
        printf("%c is not an uppercase letter\n", c);
    }
    return 0;
}

In this example, the isupper() function is used to check whether the character 'A' is an uppercase letter. Since 'A' is an uppercase letter, the function returns a nonzero value, and the output will be: 'A' is an uppercase letter'.

If the character had been a lowercase letter such as 'a', the isupper() function would return zero, and the output would be: 'a' is not an uppercase letter'.