Your call to sc.next() returns a string but you are trying store it into char.
You need to change your declaration of yn to String and modify you while loop statement to reflect the fact it is testing a string.
See below
public static void main(String[] args) {
char ch;
String yn;
String word = null;
String rev = " ";
int i,x;
Scanner sc =new Scanner(System.in);
do {
System.out.println("enter word");
word=sc.next();
x=word.length();
for(i=0;i<x;i++)
{
ch=word.charAt(i);
rev=ch+rev;
}
System.out.println("do you wish to continue(y/n");
yn = sc.next();
}while (yn.compareTo("y") == 0 ||yn.compareTo("Y") == 0);
}