Wednesday, August 31, 2011

PROGRAM TO CONVERT UPPER TO LOWER LETTER AND VICE VERSA C/C++

This program will ask user to enter any character, if the user enter uppercase letter the program will convert it into lowercase letter and vice versa.

This program is capable of convert only a character, for string conversion please check this ONE

CODING
#include<iostream.h>
#include<conio.h>
main()
{
char a;
cout<<"Enter your letter ";
cin>>a;
if(a>=65 && a<=90)
a=a+32;
else if (a>=97 && a<=122)
a=a-32;
cout<<endl<<a<<endl;
getche();
clrscr();
}


No comments:

Post a Comment