Write a program that converts lower case to uper case and vice versa of a string.

#include<stdio.h>
main()
{
int i=0;
char ch, str[100];
puts("\nEnter the string");
gets(str);
puts("Origial string:: ");
puts(str);
while(str[i]!='')
{if(str[i]>=65 && str[i]<=90)
str[i]+=32;
else if(str[i]>=97 && str[i]<=122)
str[i]-=32;
i++;
}
puts("New string:: ");
puts(str);
}
Advertisements

One thought on “Write a program that converts lower case to uper case and vice versa of a string.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s