C Program to Convert Uppercase Character to Lowercase Character

Program


#include<stdio.h>
#include<conio.h>

int main()
{
	 char c;
	 clrscr();
	 printf("Enter any character: ");
	 scanf("%c", &c);
	
	 if(c>='A' && c<='Z')
	 {
		  c = c+32;
		  printf("Lowercase is : %c", c);
	 }
	 else
	 {
	  	printf("It is not uppercase character.");
	 }
	
	 getch();
	 return(0);
}

Output of above program :

Run 1:
-------------
Enter any character: F ↲
Lowercase is: f

Run 2:
-------------
Enter any character: g ↲
It is not uppercase character.

Run 3:
-------------
Enter any character: * ↲
It is not uppercase character.

Note: ↲ indicates ENTER is pressed.