Write a c program to Convert Upper to Lower Case Alphabets & Vice-versa

Convert Upper to Lower Case Alphabets & Vice-versa

#include<stdio.h>
#include<conio.h>
void main()
{
char hm;
printf("\n Enter a Character ");
scanf("%c",&hm);
printf("\n You have entered %c ",hm);
if(hm>='a'&&hm<='z')
{
   printf("\n You have entered Lower case letter =%c",hm);
   hm = hm - 32 ;
   printf("\n The Upper case letter is =%c",hm);
}

else if(hm>='A' && hm<='Z')
{
   printf("\n You have entered Upper case letter");
   hm = hm + 32 ;
   printf("\n The Lower case letter is =%c",hm);
}

else
{
   printf("\n WRONG INPUT ");
}

getch();

}

Post a Comment

0 Comments