Mega Code Archive

 
Categories / C / Code Snippets
 

Returns nonzero if ch is a lowercase letter

//Declaration: int islower(int ch); //Return: returns nonzero if ch is a lowercase letter; otherwise zero is returned. #include <ctype.h> #include <stdio.h> int main(void) { char ch; for(;;) { ch = getchar(); if(ch == '.'){ break; } if(islower(ch)){ printf("%c is lowercase\n", ch); } } return 0; } /* 1 2 d d is lowercase g g is lowercase y y is lowercase e e is lowercase d d is lowercase Z . */