C Function Isupper
# C Library Function - isupper()
[ C Standard Library - ](#)
## Description
The C library function **int isupper(int c)** checks whether the passed character is an uppercase letter.
## Declaration
Here is the declaration for the isupper() function.
int isupper(int c);
## Parameters
* **c** -- This is the character to be checked.
## Return Value
If c is an uppercase letter, the function returns a non-zero value (true), otherwise it returns 0 (false).
## Example
The following example demonstrates the usage of the isupper() function.
#include #include int main(){ int var1 = 'M'; int var2 = 'm'; int var3 = '3'; if( isupper(var1) ) { printf("var1 = |%c| is an uppercase lettern", var1 ); } else { printf("var1 = |%c| is not an uppercase lettern", var1 ); } if( isupper(var2) ) { printf("var2 = |%c| is an uppercase lettern", var2 ); } else { printf("var2 = |%c| is not an uppercase lettern", var2 ); } if( isupper(var3) ) { printf("var3 = |%c| is an uppercase lettern", var3 ); } else { printf("var3 = |%c| is not an uppercase lettern", var3 ); } return(0);}
Let us compile and run the above program that will produce the following result:
var1 = |M| is an uppercase letter var2 = |m| is not an uppercase letter var3 = |3| is not an uppercase letter
[ C Standard Library - ](#)
YouTip