函數名: islower
頭檔:<ctype.h>
函數原型: int islower(int ch);
功 能: 判斷字元是否為小寫英文字母
參數: int ch 待檢查的字符
傳回值: ch不是小寫英文字母回傳0 , ch是小寫英文字母回傳非0
程式例:判斷輸入的字元是否為小寫英文字母
#include<ctype.h>#include<stdio.h>intmain(){charch;printf(inputacharacter:);scanf(%c,&ch);if(islower(ch)){printf(%cisloweralpha.,ch) ;}else{printf(%cisnotloweralpha.,ch);}putchar('n');return0;}
運行結果:
inputacharacter:ggisloweralpha.