碼迷,mamicode.com
首頁 > 編程語言 > 詳細

C語言常用函數-toupper()將字符轉換為大寫英文字母函數

時間:2021-07-29 16:17:17      閱讀:0      評論:0      收藏:0      [點我收藏+]

標簽:常用函數   c語言   printf   input   int   英文字母   英文   cte   返回值   

演示版本

VS2013

  • toupper()函數

toupper()函數用于把小寫字母轉換為大寫字母,不是小寫字母的不變。

語法

int toupper(int ch);

toupper()函數的語法參數說明如下:

參數ch為待轉換的字符。

toupper()函數的返回值:轉換后的字符。

示例

本示例演示用toupper()函數把小寫字母轉換為大寫字母。其具體代碼如下:

#include <stdio.h>
#include <ctype.h>

int main()
{
    char ch1, ch2;
    printf("input a character\n");
    scanf_s("%c", &ch1);
    ch2 = toupper(ch1);
    printf("transform %c to %c\n", ch1, ch2);

    return 0;
}

技術圖片

 

阿飛

2021年7月28日

C語言常用函數-toupper()將字符轉換為大寫英文字母函數

標簽:常用函數   c語言   printf   input   int   英文字母   英文   cte   返回值   

原文地址:https://www.cnblogs.com/nxopen2018/p/15072957.html

(0)
(0)
   
舉報
評論 一句話評論(0
登錄后才能評論!
? 2014 mamicode.com 版權所有  聯系我們:gaon5@hotmail.com
迷上了代碼!
4399在线看MV_久久99精品久久久久久久久久_成人又黄又爽又刺激视频_能收黄台的app不收费