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.
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:
g in uppercase is represented as G
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.