Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use C language functions to convert characters to uppercase or lowercase

Shulou Source: shulou.com Published: 2022-06-01 01:50:58 10月02日 Update

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

Tags: Function lowercase uppercase character letter language learning uppercase letter more help practical next original size file article method state theory knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Docker NVidia Shulou Information MariaDB