Write a program to accept a character and covert it upper case to lower case and lower to upper in C.

#include<stdio.h>
#include<conio.h>
void main()
{
    char ch;
    printf("Enter the character = ");
    scanf("%c",&ch);
    if((ch>='a')&&ch<='z')
    {
        ch=ch-32;
        printf("Upper case is = %c",ch);
    }
    else
    {
        ch=ch+32;
        printf("Lower case is = %c",ch);
    }
getch();
}


OUTPUT :-

Previous Post
Next Post