public static void doAnagram(int newSize) {
if (newSize==1)return;
for (int i=0;i<newSize;++i){
doAnagram(newSize-1);
if (newSize==2)
displayWord();
rotate(newSize);
}
}
public static void rotate(int newSize) {
int positon=size-newSize;
char temp=arrChar[positon];
int j;
for (j=positon+1;j<size;++j)
arrChar[j-1]=arrChar[j];
arrChar[j-1]=temp;
}