C Program to convert lower case alphabet to upper case and upper case to lower case using Built In functions

Program

#include<stdio.h>
void main()
{
	char ch;
	printf("Enter a character\n");
	scanf("%c", &ch);
	if(islower(ch))
	{
		printf("Upper Case:\t%c\n", toupper(ch));
	}
	else if(isupper(ch))
	{
		printf("Lower Case:\t%c\n", tolower(ch));
	}
	else
		printf("Invalid Character\n");
}

Output 1

Enter a character
r
Upper Case:	R

Output 2

Enter a character
W
Lower Case:	w