English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The isupper() function checks if a character is an uppercase letter (A-Z).
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.
Return value | Description |
---|---|
Non-zero integer (x > 0) | The parameter is an uppercase letter. |
0 | The parameter is not an uppercase letter. |
#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.