toggle case

here, the code of toggle

//toggle case
#include<stdio.h>
#include<conio.h>
void main()
{
char str[100];
int i;
clrscr();
printf(“enter string:”);
gets(str);
for(i=0;str[i]!=’\0′;i++)
{
if(str[i]>=’A’&&str[i]<=’Z’)
str[i]+=32;
else if
(str[i]>=’a’&&str[i]<=’z’)
str[i]-=32;
}
printf(“string in toggle case is: %s”,str);
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *