isupper() function in C programming checks whether the given character is upper case or not. isupper() function is defined in ctype.h header file.
Syntax :
int isupper ( int x );
Examples:
Input: A Output: Entered character is uppercase character Input: a Output: Entered character is not uppercase character Input: 1 Output: Entered character is not uppercase character
// C program to demonstrate // isupper() function #include <ctype.h> #include <stdio.h> int main() { char ch = 'A'; // checking uppercase if (isupper(ch)) printf("\nEntered character is uppercase character"); else printf("\nEntered character is not uppercase character"); } |
chevron_right
filter_none
Output:
Entered character is uppercase character
Application : isupper() function in C programming language is used to find out total number of uppercase present in a given senence.
Example:
Input: GEEKSFORGEEKS Output: Number of upper case present in the sentence is : 13 Input: GeeksFORGeeks Output: Number of upper case present in the sentence is : 5 Input: geeksforgeeks Output: Number of upper case present in the sentence is : 0
// C program to demonstrate // isupper() function #include <ctype.h> #include <stdio.h> // called function int ttl_upper(int i, int counter) { char ch; char a[50] = "GeeksForGeeks"; ch = a[0]; // counting of upper case while (ch != '\0') { ch = a[i]; if (isupper(ch)) counter++; i++; } // returning total number of upper case present in sentence return (counter); } int main() { int i = 0; int counter = 0; // calling function counter = ttl_upper(i, counter); printf("\nNumber of upper case present in the sentence is : %d", counter); return 0; } |
chevron_right
filter_none
Output:
Number of upper case present in the sentence is : 3
Recommended Posts:
- isxdigit() function in C Language
- isalnum() function in C Language
- Stopwatch using C language
- C Language Introduction
- Signals in C language
- fgets() and gets() in C language
- Difference between while(1) and while(0) in C language
- kbhit in C language
- chdir() in C language with Examples
- Difference between Java and C language
- A C Programming Language Puzzle
- lvalue and rvalue in C language
- How to use POSIX semaphores in C language
- Arrays in C Language | Set 2 (Properties)
- How to clear console in C language?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



