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 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 strol() function in C++ The strtol() function in C++ interprets the contents of a string as an integral number of the specified base and return its value as a long int.This function also sets an end pointer that points to the first character after the last valid numeric character of the string, if there is no such characte 3 min read towlower() function in C/C++ The towlower() is a built-in function in C/C++ which converts the given wide character into lowercase. It is defined within the cwctype header file of C++. It is a function in header file , so it is mandatory to use this header file if using this functionIt is the wide-character equivalent of the to 2 min read round() Function in C In the C language, the <math.h> header file contains the Standard Math Library that provides various mathematical functions, including the round() function. In this article, we will see how to use the round() function in C.What is round() in C?C round() is a built-in library function that roun 3 min read qsort() Function in C The qsort() in C is a library function used to sort an array of items in ascending order or descending order. It stands for "quick sort," as it implements the quicksort algorithm for sorting which is one of the fastest and most efficient algorithms to sort the array.Let's take a look at an example t 4 min read strlwr() function in C The strlwr( ) function is a built-in function in C and is used to convert a given string into lowercase. Syntax: char *strlwr(char *str); Parameter: str: This represents the given string which we want to convert into lowercase. Returns: It returns the modified string obtained after converting the ch 1 min read Like