Write a c program to Convert Upper to Lower Case Alphabets & Vice-versa - CodeTextPro | Web Tutorial | Technology

CodeTextPro.com Provides - Web design, Technology gyan, Digital marketing, Online earnings, Seo, Adsense, Technology news, Motivation and inspiration, Latest Technology Affairs, Gadgets, Blogging

Friday, January 4, 2019

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();

}

No comments:

Post a Comment