Popular Tutorials
Start Learning CCertification Courses
Created with over a decade of experience and thousands of feedback.
Python online compiler
JavaScript online compiler
SQL online compiler
Java online compiler
HTML online compiler
C online compiler
C++ online compiler
C# online compiler
PHP online compiler
Swift online compiler
Kotlin online compiler
TypeScript online compiler
Go online compiler
Rust online compiler
Scala online compiler
Dart online compiler
R online compiler
Ruby online compiler
C isupper()
The isupper() function checks whether a character is an uppercase alphabet (A-Z) or not.
C isupper() Prototype
int isupper(int argument);
Function isupper() takes a single argument in the form of an integer and returns a value of type int.
Even though, isupper() takes integer as an argument, character is passed to the function. Internally, the character is converted to its ASCII for the check.
It is defined in <ctype.h> header file.
C isupper() Return Value
| Return Value | Remarks |
|---|---|
| Non-zero integer ( x > 0 ) | Argument is an uppercase alphabet. |
| Zero (0) | Argument is not an uppercase alphabet. |
Example: C isupper() function
#include <stdio.h>
#include <ctype.h>
int main()
{
char c;
c = 'C';
printf("Return value when uppercase character %c is passed to isupper(): %d", c, isupper(c));
c = '+';
printf("\nReturn value when another character %c is passed to is isupper(): %d", c, isupper(c));
return 0;
}
Output
Return value when uppercase character C is passed to isupper(): 1 Return value when another character + is passed to is isupper(): 0
Note: You may get different integer value when uppercase alphabet is passed to isupper() on your system. But, when you pass any character other than uppercase character to isupper(), it always returns 0.
Did you find this article helpful?