/* 11(a). For a given sentence w.a.p. to replace lowercase letter by uppercase and vice-versa */
#include<stdio.h>
#include<conio.h>
void main()
{
char get,ch[80]; /* Variable Declarations */
int count=0,i;
clrscr();
printf("Type the text below(One Line or 80 Chars)and press ENTER key:\n\a\a");
do
{
get=getchar();
ch[count++]=get;
}while(get!='\n');
printf("\n\nThe cases are altered in the above sentence is as follows :\n");
/* Converting the case of the sentence */
for (i=0;i<count-1;i++)
{
get=((ch[i]>='a') && (ch[i]<='z'))?ch[i]-32:((ch[i]>='A') && (ch[i]<='Z'))?ch[i]+32:ch[i];
putchar(get);
//if (islower(ch[i])) putchar(toupper(ch[i]));
//else putchar(tolower(ch[i]));
}
getch();
}