toupper() function in C Last Updated : 10 Jan, 2025 Comments Improve Suggest changes Like Article Like Report The toupper() function is used to convert lowercase alphabet to uppercase. i.e. If the character passed is a lowercase alphabet then the toupper() function converts a lowercase alphabet to an uppercase alphabet. It is defined in the ctype.h header file.Syntax: int toupper(int ch);Parameter: It accepts a single parameter: ch: This represents the character to be converted to uppercase.Returns: This function returns the uppercase character corresponding to the ch.Below programs illustrate the toupper() function in C:Example 1:- c // C program to demonstrate // example of toupper() function. #include <ctype.h> #include <stdio.h> int main() { char ch; ch = 'g'; printf("%c in uppercase is represented as %c", ch, toupper(ch)); return 0; } Outputg in uppercase is represented as GExample 2:- C // C program to demonstrate // example of toupper() function. #include <ctype.h> #include <stdio.h> int main() { int j = 0; char str[] = "geekforgeeks\n"; char ch; while (str[j]) { ch = str[j]; putchar(toupper(ch)); j++; } return 0; } OutputGEEKFORGEEKSNote: If the character passed in the toupper() is any of these three1. uppercase character2. special symbol3. digittoupper() will return the character as it is. Example : C // C program to demonstrate // example of toupper() function. #include <ctype.h> #include <stdio.h> int main() { int j = 0; char str[] = "GeEks@123\n"; char ch; while (str[j]) { ch = str[j]; putchar(toupper(ch)); j++; } return 0; } // code is contributed by codersaty Output:GEEKS@123 Comment More infoAdvertise with us Next Article toupper() function in C B bansal_rtk_ Follow Improve Article Tags : Misc C Language C-String C-Functions Practice Tags : Misc Similar Reads towupper() function in C/C++ The towupper() is a built-in function in C/C++ which converts the given wide character into uppercase. It is defined within the cwctype header file of C++. Syntax: wint_t towupper( wint_t ch ) Parameter: The function accepts a single mandatory parameter ch which specifies the wide character which we 2 min read strupr() function in c The strupr( ) function is used to converts a given string to uppercase. Syntax: char *strupr(char *str); Parameter: str: This represents the given string which we want to convert into uppercase. Returns: It returns the modified string obtained after converting the characters of the given string str 1 min read tolower() Function in C C tolower() function is part of the C standard Library used to convert the uppercase alphabet to the lowercase alphabet. It does not affect characters other than uppercase characters.ExampleC#include <stdio.h> #include <ctype.h> int main() { // Converting 'A' to 'a' printf("%c", tolower( 2 min read tolower() Function in C++ The C++ tolower() function converts an uppercase alphabet to a lowercase alphabet. It is a predefined function of ctype.h header file. If the character passed is an uppercase alphabet, then the tolower() function converts an uppercase alphabet to a lowercase alphabet. This function does not affect a 2 min read Function Pointer in C In C, a function pointer is a type of pointer that stores the address of a function, allowing functions to be passed as arguments and invoked dynamically. It is useful in techniques such as callback functions, event-driven programs, and polymorphism (a concept where a function or operator behaves di 6 min read Like