What is isupper() in C?
isupper() is a C library function that checks whether or not the character passed as a parameter is an uppercase letter.
Library
#include<ctype.h>
Syntax
Below is the declaration of isupper(),
int isupper(int ch);
where ch is the character to be checked. The return type of the function is int.
If the letter passed to the function is an uppercase letter, the function returns a non-zero value. Otherwise, the function returns zero.
Alternative approach
An alternative approach (without using isupper()) to check whether or not a character is an uppercase letter is to check if the character lies between and (inclusive).
If the character lies between and (inclusive), it is an uppercase letter. Otherwise, it is not.
ASCII values of uppercase letters
Code
1. With isupper()
#include<stdio.h>#include<ctype.h>int main() {char str[] = {'a', '!', '2', 'M'};int i = 0;while (i < 4) {int returnValue = isupper(str[i]);if (returnValue > 0)printf("%c is an uppercase letter.\n", str[i]);elseprintf("%c is not an uppercase letter.\n", str[i]);++i;}return 0;}
2. Without isupper()
#include<stdio.h>#include<ctype.h>int main() {char str[] = {'a', '!', '2', 'M'};int i = 0;while (i < 4) {if (str[i] >= 65 && str[i] <= 90)printf("%c is an uppercase letter.\n", str[i]);elseprintf("%c is not an uppercase letter.\n", str[i]);++i;}return 0;}
Free Resources
Copyright ©2026 Educative, Inc. All rights reserved