I erred on the strlen(word)%2==0 idea. Not necessary, please drop it.
Here's your code, with a few tweaks. The tweaks are right below the code that needs tweaking:
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<string.h>
#include<ctype.h>
#include<dos.h>
/*All these global variables, let's remove and make them local variables instead. Seems a PITA maybe, but it pays big dividends in programming.
char word[289];
char *str1,*str2;
char *rev;
char *upper;
char *lower;
char *dup;
char choice[3];
int a,b,x,y,i,h,z,j,temp;
*/
//void main()
int main(void) //<===== Always int main, never void
{
int len, i, j;
char dup[250]; //nice and big :)
char word[250]; // ditto
char choice;
//input: //use functions and logic, and not labels 95% of the time.
//clrscr(); //this crashes my IDE, immediately
printf("\n\n"); //gives the separation we need
printf("ENTER A WORD:");
gets (word); //unsafe! but we'll use it for now
printf("\nYOUR WORD IS:");
puts (word);
//dup=strdup(word);
strcpy(dup, word);
len = strlen(word);
//menu:
//for(z=1;z<=5;z++)
do
{
printf( "\n\n1:REVERSE\n2:ACSENDING ORDER \n3:DESCENDING ORDER\n\4:UPPERCASE HIGHER HALF\n5:UPPERCASE LOWER HALF\n:");
gets (choice);
printf("\nYOUR CHOICE:");
puts(choice);
switch(choice[y])
{
case'1': {
rev= strrev(word);
printf("\n\t\t\t\REVERSE WORD:%s",rev);
getch();
// clrscr();
printf("\nYOUR WORD IS:");
puts (dup);
break;
}
case '2':{
for(a=0;a<strlen(word);a++)
{
for(b=0;b<strlen(word);b++)
{
if(word[a]<word[b])
{
temp=word[a];
word[a]=word[b];
word[b]=temp;
printf("\n\t\t\t\RESULT:");
puts(word);
}
}
}
getch();
//clrscr();
printf("\nYOUR WORD IS:");
puts (dup);
break;
}
case'3':{
for(a=0;a<strlen(word);a++)
{
for(b=0;b<strlen(word);b++)
{
if(word[a]>word[b])
{
temp=word[a];
word[a]=word[b];
word[b]=temp;
printf("\n\t\t\t\RESULT:");
puts( word);
}
}
}
getch();
clrscr();
printf("\nYOUR WORD IS:");
puts (dup);
break;
}
case '4': {
if(strlen(word)%2==0)
{
for(i=0;i<strlen(word)/2;i++)
word[i]==toupper(word[i]);
{
for(h=0;h<strlen(word)/2;h++)
word[h]==tolower(word[h]);
printf("UPPERCASE HIGHER HALF:");
puts(word);
}
}
if(strlen(word)%2!=0)
{
for(i=0;i<strlen(word)/2+1;i++)
word[i]==toupper(word[i]);
{
for(h=0;h<strlen(word)/2+1;h++)
word[h]==tolower(word[h]);
printf("UPPERCASE HIGHER HALF:");
puts(word);
}
}
getch();
clrscr();
printf("\nYOUR WORD IS:");
puts (dup);
break;
}
}while(choice != '0');
}
printf("\n\n\t\t\t press enter when ready");
(void) getchar();
return 0;
}
Lots of things wrong with the code, but the important thing right now, is to make it readable, and get the basic flow right. Then work with the details of each switch statement, one at a time, to make it right.
This is an example of what I had in mind for the toupper and tolower part:
#include <stdio.h>
#include <string.h>
#define SIZE 100
int main() {
int i, n, len;
char s[SIZE];
printf("\n\n");
fgets(s, sizeof(s), stdin);
printf("\n%s", s);
len = strlen(s);
//fgets() is a great input technique, but it adds a newline char
//that I don't want to include (although I could).
if(s[len-1]=='\n') //find the newline near the end of the phrase
s[len-1]='\0'; //and replace it with the end of string char
--len; //reduce the length of the string by one
for(i=0;i<len;i++) {
if(i < len/2)
s[i] = toupper(s[i]);
else
s[i] = tolower(s[i]);
}
printf("\n%s", s);
printf("\n\n\t\t\t press enter when ready");
(void) getchar();
return 0;
}