Whether the character is uppercase or lowercase and convert it into another -
#include <stdio.h>
int main()
{ char ch;
printf("Enter the character ");
scanf(" %c",&ch);
if(ch>= 'A'&& ch<='Z')
{ printf("Uppercase\n");
printf("The lowercase is %c",ch+32); }
else if (ch>='a'&& ch<='z')
{ printf("lowercase\n");
printf("The uppercase is %c",ch-32); }
else
printf("Enter valid input");
return 0;
}
Output -
Enter the character a
lowercase
The uppercase is A
0 Comments