
wap a program that reverse word of string in alphabetical order. e.g. input by user The purpose of education is to replace an empty mind with an open one
output:- of education is an empty an open

public class Sort { public static void main(String[] args) { int i,j,temp; String s="global analytics"; int c[]=new int [20]; System.out.println(s);
for(i=0;i<16;i++)
{
System.out.print(c[i]=s.charAt(i));
}
for(i=0;i<16;i++)
{
for(j=i;j<16;j++)
{
if(c[i]>c[j])
{
temp=c[i];
c[i]=c[j];
c[j]=temp;
}
}
}
for(i=0;i<16;i++)
{
System.out.println(c[i]);
}
for(i=0;i<17;i++)
{
String aChar = new Character((char)c[i]).toString();
System.out.print(" "+aChar);
}
} }
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.