isupper() फंक्शन का उपयोग यह जांचने के लिए किया जाता है कि कैरेक्टर अपरकेस है या नहीं। यह सफल होने पर नॉन-ज़ीरो मान लौटाता है, अन्यथा शून्य लौटाता है। यह ctype.h हेडर फाइल में घोषित है।
C भाषा में isupper() का सिंटैक्स यहाँ है,
int isupper(int character);
यहाँ,
character - वह कैरेक्टर जिसे जांचा जाना है।
C भाषा में isupper() का एक उदाहरण यहाँ है,
उदाहरण
#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;
}
आउटपुट
The character is not uppercase The character is uppercase
उपरोक्त प्रोग्राम में, दो वेरिएबल val1 और val2 रैंडम अल्फाबेट्स के साथ आरंभ किए जाते हैं और isupper() फंक्शन का उपयोग करके, इन वेरिएबल को जांचा जाता है कि वे अपरकेस लेटर हैं या नहीं।
char val1 = 's';
char val2 = 'S';
if(isupper(val1))
printf("The character is uppercase\n");
else
printf("The character is not uppercase\n");