C tolower function changes the letter to lowercase

Syntax

C tolower function has the following syntax.

int tolower(int ch);

C tolower function is from header file ctype.h.

Description

C tolower function returns the lowercase equivalent of ch if ch is a letter or ch is returned unchanged.

Example

The following changes the letter Q from uppercase to lowercase and use putchar to output the result to the screen.


#include <ctype.h>
#include <stdio.h>
/* w w w.ja v a 2  s .co m*/
int main(void){

  putchar(tolower('Q'));

}

The code above generates the following result.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h