Tuesday, February 17, 2015

C Program to convert a lowercase alphabet to uppercase or vice versa

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
char ch;
cout<<"Enter any Alphabet:";
cin>>ch;

if(ch>=a&&ch<=z)
{
cout<<"
You have entered a lowercase alphabet";

ch=ch-32;
cout<<"

The uppercase alphabet is "<<ch;

}
else
{
cout<<"
You have entered an Uppercase alphabet";

ch=ch+32;
cout<<"

The lowercase alphabet is "<<ch;

}
getch();
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.