How to use C language functions to convert characters to uppercase or lowercase
This article mainly introduces "how to use C language functions to convert characters to uppercase or lowercase". In daily operations, I believe many people have doubts about how to use C language functions to convert characters to uppercase or lowercase. Xiaobian consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to use C language functions to convert characters to uppercase or lowercase"! Next, please follow the editor to study!
The C library function int toupper (int c) converts lowercase letters to uppercase letters.
The C library function int tolower (int c) converts uppercase letters to lowercase letters.
# include # include / / contains the header file int main () {char c; char temp; / / of the case conversion function to determine the transfer. Causes printf to output character c in original uppercase / lowercase state. Printf ("enter a character:"); scanf ("% c", & c); temp=toupper (c); / / or use tolower (); if (temp > ='A'& & temp