Encoders
Hub for Computer Whizzes Register to join us

Encoders > More... > C > Program

/* Function tolower(a) to convert an upper case character to lower case
   and leave the rest of the characters unchanged. */

#include <stdio.h>

char tolower(char a);

main()
{
	printf("%c\n",tolower('S'));
}

char tolower(char a)
{
	if(a>='A'&&a<='Z')
		return a+'a'-'A';
	else
		return a;
}