Ticker

6/recent/ticker-posts

Check whether the character is uppercase or lowercase and convert it into another Program




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

Post a Comment

0 Comments