English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C Language Basic Tutorial

C Language Flow Control

C Language Functions

C Language Arrays

C Language Pointers

C Language Strings

C Language Structure

C Language File

C Others

C Language Reference Manual

Usage and example of C library function isupper()

C Standard Library <ctype.h>

The isupper() function checks if a character is an uppercase letter (A-Z).

C isupper() function prototype

int isupper(int argument);

The isupper() function takes a single parameter in the form of an integer and returns a value of type int.

Even if isupper() takes an integer as a parameter, the character is passed to the function. Internally, the character is converted to its ASCII for checking.

It is<ctype.h>Defined in the header file.

C isupper() return value

Return valueDescription
Non-zero integer (x > 0)

The parameter is an uppercase letter.

0

The parameter is not an uppercase letter.

Example: C isupper() function

#include <stdio.h>
#include <ctype.h>
int main()
{
    char c;
    c = 'C';
    printf("The return value of the uppercase character %c passed to isupper() is: %d", c, isupper(c));
    c = '+';
    printf("\nThe return value of the uppercase character %c passed to isupper() is: %d", c, isupper(c));
   return 0;
}

Output result

The return value of the isupper() function when passing the uppercase character 'C': 1
Uppercase Characters - Return value when passed to isupper(): 0

Note:When passing uppercase letters to the isupper() on the system, you may get different integer values. However, when you pass any character other than an uppercase letter to isupper(), it always returns 0.

C Standard Library <ctype.h>