English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The functionisupper()
used to check if a character is uppercase. If successful, it will return a non-zero value, otherwise it will return zero. Declared in the "ctype.h" header file.
This isisupper()
C Language Syntax,
int isupper(int character);
Here,
Character-the character to be checked.
This isisupper()
C Language Example,
#include<stdio.h> #include<ctype.h> int main() { char val1 = 's'; char val2 = 'S'; if(isupper(val1)) printf("The character is uppercase\n"); else printf("The character is not uppercase\n"); if(isupper(val2)) printf("The character is uppercase\n"); else printf("The character is not uppercase"); return 0; }
Output Result
The character is not uppercase The character is uppercase
In the above program, two variables val are initialized with random letters.1val2andisupper()
The function checks whether these variables are uppercase letters.
char val1 = 's'; char val2 = 'S'; if(isupper(val1)) printf("The character is uppercase\n"); else printf("The character is not uppercase\n");